Index: chrome/browser/ui/views/frame/browser_view.cc |
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc |
index 2deae98f3f4f27b3af24bad518cd95c7a44ed0a9..cde72c14824dbcacbd7cc0b2a8cb5f5cfa0cdcbe 100644 |
--- a/chrome/browser/ui/views/frame/browser_view.cc |
+++ b/chrome/browser/ui/views/frame/browser_view.cc |
@@ -61,6 +61,7 @@ |
#include "chrome/browser/ui/views/accessibility/invert_bubble_view.h" |
#include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" |
#include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" |
+#include "chrome/browser/ui/views/browser_modal_dialog.h" |
#include "chrome/browser/ui/views/download/download_in_progress_dialog_view.h" |
#include "chrome/browser/ui/views/download/download_shelf_view.h" |
#include "chrome/browser/ui/views/exclusive_access_bubble_views.h" |
@@ -1580,15 +1581,17 @@ bool BrowserView::CanMinimize() const { |
bool BrowserView::CanActivate() const { |
app_modal::AppModalDialogQueue* queue = |
app_modal::AppModalDialogQueue::GetInstance(); |
- if (!queue->active_dialog() || !queue->active_dialog()->native_dialog() || |
- !queue->active_dialog()->native_dialog()->IsShowing()) { |
+ if ((!queue->active_dialog() || !queue->active_dialog()->native_dialog() || |
+ !queue->active_dialog()->native_dialog()->IsShowing()) && |
+ !BrowserModalDialogList::GetInstance()->IsShowing()) { |
sky
2017/05/16 12:40:33
This has BrowserView needing to know about both ty
zmin
2017/05/16 22:22:02
Done.
|
return true; |
} |
#if defined(USE_AURA) && defined(OS_CHROMEOS) |
// On Aura window manager controls all windows so settings focus via PostTask |
// will make only worse because posted task will keep trying to steal focus. |
- queue->ActivateModalDialog(); |
+ if (!BrowserModalDialogList::GetInstance()->ActivateModalDialog()) |
+ queue->ActivateModalDialog(); |
#else |
// If another browser is app modal, flash and activate the modal browser. This |
// has to be done in a post task, otherwise if the user clicked on a window |
@@ -2595,6 +2598,8 @@ bool BrowserView::DoCutCopyPasteForWebContents( |
} |
void BrowserView::ActivateAppModalDialog() const { |
+ if (BrowserModalDialogList::GetInstance()->ActivateModalDialog()) |
+ return; |
// If another browser is app modal, flash and activate the modal browser. |
app_modal::AppModalDialog* active_dialog = |
app_modal::AppModalDialogQueue::GetInstance()->active_dialog(); |