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

Unified Diff: chrome/browser/ui/views/javascript_app_modal_dialog_views_x11.cc

Issue 666533007: Move JavaScriptDialogManager, JavascriptAppModalDialogViews to components/app_modal_dialogs (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 6 years, 1 month 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/views/javascript_app_modal_dialog_views_x11.cc
diff --git a/chrome/browser/ui/views/javascript_app_modal_dialog_views_x11.cc b/chrome/browser/ui/views/javascript_app_modal_dialog_views_x11.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d11b2d5b973d48b96412b2f4a85c7dd8bc8fcb80
--- /dev/null
+++ b/chrome/browser/ui/views/javascript_app_modal_dialog_views_x11.cc
@@ -0,0 +1,33 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/views/javascript_app_modal_dialog_views_x11.h"
+
+#include "chrome/browser/ui/views/javascript_app_modal_event_blocker_x11.h"
+#include "ui/views/widget/widget.h"
+
+JavaScriptAppModalDialogViewsX11::JavaScriptAppModalDialogViewsX11(
+ JavaScriptAppModalDialog* parent)
+ : JavaScriptAppModalDialogViews(parent) {}
+
+JavaScriptAppModalDialogViewsX11::~JavaScriptAppModalDialogViewsX11() {
+}
+
+void JavaScriptAppModalDialogViewsX11::ShowAppModalDialog() {
+ // BrowserView::CanActivate() ensures that other browser windows cannot be
+ // activated for long while the dialog is visible. Block events to other
+ // browser windows so that the user cannot interact with other browser windows
+ // in the short time that the other browser windows are active. This hack is
+ // unnecessary on Windows and Chrome OS.
+ // TODO(pkotwicz): Find a better way of doing this and remove this hack.
+ if (!event_blocker_x11_.get()) {
+ event_blocker_x11_.reset(
+ new JavascriptAppModalEventBlockerX11(GetWidget()->GetNativeView()));
+ }
+ GetWidget()->Show();
+}
+
+void JavaScriptAppModalDialogViewsX11::WindowClosing() {
+ event_blocker_x11_.reset();
+}

Powered by Google App Engine
This is Rietveld 408576698