OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/views/javascript_app_modal_dialog_views_x11.h" |
| 6 |
| 7 #include "chrome/browser/ui/views/javascript_app_modal_event_blocker_x11.h" |
| 8 #include "ui/views/widget/widget.h" |
| 9 |
| 10 JavaScriptAppModalDialogViewsX11::JavaScriptAppModalDialogViewsX11( |
| 11 JavaScriptAppModalDialog* parent) |
| 12 : JavaScriptAppModalDialogViews(parent) {} |
| 13 |
| 14 JavaScriptAppModalDialogViewsX11::~JavaScriptAppModalDialogViewsX11() { |
| 15 } |
| 16 |
| 17 void JavaScriptAppModalDialogViewsX11::ShowAppModalDialog() { |
| 18 // BrowserView::CanActivate() ensures that other browser windows cannot be |
| 19 // activated for long while the dialog is visible. Block events to other |
| 20 // browser windows so that the user cannot interact with other browser windows |
| 21 // in the short time that the other browser windows are active. This hack is |
| 22 // unnecessary on Windows and Chrome OS. |
| 23 // TODO(pkotwicz): Find a better way of doing this and remove this hack. |
| 24 if (!event_blocker_x11_.get()) { |
| 25 event_blocker_x11_.reset( |
| 26 new JavascriptAppModalEventBlockerX11(GetWidget()->GetNativeView())); |
| 27 } |
| 28 GetWidget()->Show(); |
| 29 } |
| 30 |
| 31 void JavaScriptAppModalDialogViewsX11::WindowClosing() { |
| 32 event_blocker_x11_.reset(); |
| 33 } |
OLD | NEW |