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

Side by Side Diff: chrome/browser/ui/views/javascript_app_modal_dialog_views_x11.cc

Issue 819083002: Fix AppModalDialogHelper to deal with a TabStrip without an active tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/javascript_app_modal_dialog_views_x11.h" 5 #include "chrome/browser/ui/views/javascript_app_modal_dialog_views_x11.h"
6 6
7 #include "chrome/browser/ui/blocked_content/app_modal_dialog_helper.h" 7 #include "chrome/browser/ui/blocked_content/app_modal_dialog_helper.h"
8 #include "chrome/browser/ui/views/javascript_app_modal_event_blocker_x11.h" 8 #include "chrome/browser/ui/views/javascript_app_modal_event_blocker_x11.h"
9 #include "components/app_modal/javascript_app_modal_dialog.h" 9 #include "components/app_modal/javascript_app_modal_dialog.h"
10 #include "ui/views/widget/widget.h" 10 #include "ui/views/widget/widget.h"
11 11
12 JavaScriptAppModalDialogViewsX11::JavaScriptAppModalDialogViewsX11( 12 JavaScriptAppModalDialogViewsX11::JavaScriptAppModalDialogViewsX11(
13 app_modal::JavaScriptAppModalDialog* parent) 13 app_modal::JavaScriptAppModalDialog* parent)
14 : app_modal::JavaScriptAppModalDialogViews(parent), 14 : app_modal::JavaScriptAppModalDialogViews(parent),
15 helper_(new AppModalDialogHelper(parent->web_contents())) { 15 helper_(
16 new AppModalDialogHelper(parent ? parent->web_contents() : nullptr)) {
16 } 17 }
17 18
18 JavaScriptAppModalDialogViewsX11::~JavaScriptAppModalDialogViewsX11() { 19 JavaScriptAppModalDialogViewsX11::~JavaScriptAppModalDialogViewsX11() {
19 } 20 }
20 21
21 void JavaScriptAppModalDialogViewsX11::ShowAppModalDialog() { 22 void JavaScriptAppModalDialogViewsX11::ShowAppModalDialog() {
22 // BrowserView::CanActivate() ensures that other browser windows cannot be 23 // BrowserView::CanActivate() ensures that other browser windows cannot be
23 // activated for long while the dialog is visible. Block events to other 24 // activated for long while the dialog is visible. Block events to other
24 // browser windows so that the user cannot interact with other browser windows 25 // browser windows so that the user cannot interact with other browser windows
25 // in the short time that the other browser windows are active. This hack is 26 // in the short time that the other browser windows are active. This hack is
26 // unnecessary on Windows and Chrome OS. 27 // unnecessary on Windows and Chrome OS.
27 // TODO(pkotwicz): Find a better way of doing this and remove this hack. 28 // TODO(pkotwicz): Find a better way of doing this and remove this hack.
28 if (!event_blocker_x11_.get()) { 29 if (!event_blocker_x11_.get()) {
29 event_blocker_x11_.reset( 30 event_blocker_x11_.reset(
30 new JavascriptAppModalEventBlockerX11(GetWidget()->GetNativeView())); 31 new JavascriptAppModalEventBlockerX11(GetWidget()->GetNativeView()));
31 } 32 }
32 GetWidget()->Show(); 33 GetWidget()->Show();
33 } 34 }
34 35
35 void JavaScriptAppModalDialogViewsX11::WindowClosing() { 36 void JavaScriptAppModalDialogViewsX11::WindowClosing() {
36 event_blocker_x11_.reset(); 37 event_blocker_x11_.reset();
37 } 38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698