Index: chrome/browser/ui/browser_commands.cc |
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc |
index f3d453ff374092e9a74c9d2010626efe6bed15b9..0be70c2d4b03815540aaa88de6d97e777afc9ff6 100644 |
--- a/chrome/browser/ui/browser_commands.cc |
+++ b/chrome/browser/ui/browser_commands.cc |
@@ -64,7 +64,7 @@ |
#include "components/bookmarks/browser/bookmark_utils.h" |
#include "components/google/core/browser/google_util.h" |
#include "components/translate/core/browser/language_state.h" |
-#include "components/web_modal/web_contents_modal_dialog_manager.h" |
+#include "components/web_modal/popup_manager.h" |
#include "content/public/browser/devtools_agent_host.h" |
#include "content/public/browser/navigation_controller.h" |
#include "content/public/browser/navigation_entry.h" |
@@ -109,7 +109,6 @@ using content::OpenURLParams; |
using content::Referrer; |
using content::SSLStatus; |
using content::WebContents; |
-using web_modal::WebContentsModalDialogManager; |
namespace chrome { |
namespace { |
@@ -251,9 +250,14 @@ bool IsShowingWebContentsModalDialog(const Browser* browser) { |
if (!web_contents) |
return false; |
- WebContentsModalDialogManager* web_contents_modal_dialog_manager = |
- WebContentsModalDialogManager::FromWebContents(web_contents); |
- return web_contents_modal_dialog_manager->IsDialogActive(); |
+ // TODO(gbillock): This gets called by the CanPrint method, and may be too |
+ // restrictive if we allow print preview to overlap -- we should just queue |
+ // print requests or attach a user gesture or whatever we know. |
+ // Note: check because tests may not have a popup manager. |
+ if (!browser->popup_manager()) |
+ return false; |
+ |
+ return browser->popup_manager()->IsWebModalDialogActive(web_contents); |
} |
bool PrintPreviewShowing(const Browser* browser) { |