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..1a5cb4eb1695e47b13a0fe32f6bbb8982e25e2ef |
--- /dev/null |
+++ b/chrome/browser/ui/views/javascript_app_modal_dialog_views_x11.cc |
@@ -0,0 +1,36 @@ |
+// Copyright (c) 2012 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" |
msw
2014/10/30 00:20:32
It's a shame this is blocking the removal of chrom
pkotwicz
2014/10/30 02:46:14
The right place for this logic is in WindowModalit
|
+#include "ui/views/widget/widget.h" |
+ |
+//////////////////////////////////////////////////////////////////////////////// |
+// JavaScriptAppModalDialogViews, public: |
pkotwicz
2014/10/30 02:46:14
Get rid of this comment
oshima
2014/10/31 15:54:45
Done.
|
+ |
+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(); |
+} |