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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012 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"
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
8 #include "ui/views/widget/widget.h"
9
10 ////////////////////////////////////////////////////////////////////////////////
11 // JavaScriptAppModalDialogViews, public:
pkotwicz 2014/10/30 02:46:14 Get rid of this comment
oshima 2014/10/31 15:54:45 Done.
12
13 JavaScriptAppModalDialogViewsX11::JavaScriptAppModalDialogViewsX11(
14 JavaScriptAppModalDialog* parent)
15 : JavaScriptAppModalDialogViews(parent) {}
16
17 JavaScriptAppModalDialogViewsX11::~JavaScriptAppModalDialogViewsX11() {
18 }
19
20 void JavaScriptAppModalDialogViewsX11::ShowAppModalDialog() {
21 // BrowserView::CanActivate() ensures that other browser windows cannot be
22 // activated for long while the dialog is visible. Block events to other
23 // browser windows so that the user cannot interact with other browser windows
24 // in the short time that the other browser windows are active. This hack is
25 // unnecessary on Windows and Chrome OS.
26 // TODO(pkotwicz): Find a better way of doing this and remove this hack.
27 if (!event_blocker_x11_.get()) {
28 event_blocker_x11_.reset(
29 new JavascriptAppModalEventBlockerX11(GetWidget()->GetNativeView()));
30 }
31 GetWidget()->Show();
32 }
33
34 void JavaScriptAppModalDialogViewsX11::WindowClosing() {
35 event_blocker_x11_.reset();
36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698