Don't attempt to show validation bubble for unparented web contents.

This fix is speculative because I can't actually repro the bug.

BUG=616990

Review-Url: https://codereview.chromium.org/2104513004
Cr-Commit-Position: refs/heads/master@{#402349}
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 2b43c86..c038819 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1261,6 +1261,10 @@
                                     const gfx::Rect& anchor_in_root_view,
                                     const base::string16& main_text,
                                     const base::string16& sub_text) {
+  // If the web contents is unparented (e.g. in a blocked popup) it does not
+  // make sense to show a validation message. See http://crbug.com/616990
+  if (!web_contents->GetTopLevelNativeWindow())
+    return;
   validation_message_bubble_ =
       TabDialogs::FromWebContents(web_contents)
           ->ShowValidationMessage(anchor_in_root_view, main_text, sub_text);