It happens when Pansy comments she hasn't seen Blaise in a while. The six of them are sitting in a booth and it's the first time Harry realises he's indeed not seen Blaise since he went into the bathrooms when they arrived some hours ago. 