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

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

Issue 13896011: Make javascript dialogs into top-level windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix non-aura build. Created 7 years, 8 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
« no previous file with comments | « no previous file | ui/views/widget/desktop_aura/desktop_native_widget_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 016ffe5e0d072b0a256e317d0faa31696c7f2a53..3227e3378a424c47fda94c884eafec27adc9d46f 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
@@ -84,13 +84,20 @@ JavaScriptAppModalDialog::~JavaScriptAppModalDialog() {
NativeAppModalDialog* JavaScriptAppModalDialog::CreateNativeDialog() {
gfx::NativeWindow parent_window =
web_contents()->GetView()->GetTopLevelNativeWindow();
+
#if defined(USE_AURA)
+#if defined(OS_WIN)
+ // JS dialogs should always be top-level windows in desktop Aura on Windows.
+ parent_window = NULL;
+#else
if (!parent_window->GetRootWindow()) {
// When we are part of a WebContents that isn't actually being displayed on
// the screen, we can't actually attach to it.
parent_window = NULL;
}
-#endif
+#endif // defined(OS_WIN)
+#endif // defined(USE_AURA)
+
return NativeAppModalDialog::CreateNativeJavaScriptPrompt(this,
parent_window);
}
« no previous file with comments | « no previous file | ui/views/widget/desktop_aura/desktop_native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698