Call browser->IsPopup() to avoid the unnecessary call to GetParent().