Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6569)

Unified Diff: chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc

Issue 11829040: Fix the content_browsertests everywhere maybe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix SimpleMessageBoxViews asan failure. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc
diff --git a/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc b/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc
index 261a8fc34ea465d9ac4e54ae9020b3ad463f6cc8..be2c7e84e7fed6fa251388f9dc5bfb9b81a08c7c 100644
--- a/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc
+++ b/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc
@@ -10,6 +10,10 @@
#include "content/public/browser/web_contents_view.h"
#include "ui/base/text/text_elider.h"
+#if defined(USE_AURA)
+#include "ui/aura/root_window.h"
+#endif
+
using content::JavaScriptDialogCreator;
using content::WebContents;
@@ -80,6 +84,13 @@ JavaScriptAppModalDialog::~JavaScriptAppModalDialog() {
NativeAppModalDialog* JavaScriptAppModalDialog::CreateNativeDialog() {
gfx::NativeWindow parent_window =
web_contents()->GetView()->GetTopLevelNativeWindow();
+#if defined(USE_AURA)
+ if (!parent_window->GetRootWindow()) {
+ // When we are part of a WebContents that isn't actually being displayed on
Ben Goodger (Google) 2013/01/15 18:19:52 Does this happen when a js alert happens before a
Elliot Glaysher 2013/01/15 19:27:51 Which hidden root window? AFAIK, there never was o
+ // the screen, we can't actually attach to it.
+ parent_window = NULL;
+ }
+#endif
return NativeAppModalDialog::CreateNativeJavaScriptPrompt(this,
parent_window);
}

Powered by Google App Engine
This is Rietveld 408576698