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

Unified Diff: chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm

Issue 287123002: [WebModals] New API for browser-scoped popup management. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make PopupManager a thin API for WCMDM Created 6 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
diff --git a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
index 94d0dca5f38b18171b6e6272a14f0257a599f7dd..21fa8f6f651155b296ac4646b82c223b05afb3df 100644
--- a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
+++ b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
@@ -207,11 +207,11 @@ class DevtoolsNotificationBridge : public content::NotificationObserver {
- (void)close {
// |windowWillClose:| could have already been called. http://crbug.com/279505
if (host_) {
- web_modal::WebContentsModalDialogManager* modalDialogManager =
- web_modal::WebContentsModalDialogManager::FromWebContents(
- host_->host_contents());
- if (modalDialogManager &&
- modalDialogManager->IsDialogActive()) {
+ // TODO(gbillock): Change this API to say directly if the current popup
+ // should block tab close? This is a bit over-reaching.
+ Browser* browser = chrome::BrowserFromWebContents(host_->host_contents());
+ if (browser && browser->popup_manager()->IsWebModalDialogActive(
+ host_->host_contents())) {
return;
}
}
@@ -234,6 +234,9 @@ class DevtoolsNotificationBridge : public content::NotificationObserver {
// it steals key-ness from the popup. Don't close the popup when this
// happens. There's an extra windowDidResignKey: notification after the
// modal dialog closes that should also be ignored.
+ // TODO(gbillock): Repoint to the PopupManager. Is this even an issue this
+ // class needs to worry about? Or can we eliminate this case through the
+ // PopupManager itself?
web_modal::WebContentsModalDialogManager* modalDialogManager =
web_modal::WebContentsModalDialogManager::FromWebContents(
host_->host_contents());

Powered by Google App Engine
This is Rietveld 408576698