I really love this moment in the books. I don't think Dumbledore was trying to make Harry feel better, I think he genuinely thought Harry had become a good, brave man and Dumbledore truly felt better he had such a companion,