summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm
diff options
context:
space:
mode:
authorgbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-15 00:16:47 +0000
committergbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-15 00:16:47 +0000
commit010152f1c2f749b629ad20d90df33d13355b5797 (patch)
tree2425644209cfc1f34ae5719c63030a70aae48e58 /chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm
parent093cc2119996683baed6074ad764d86aab55e782 (diff)
downloadchromium_src-010152f1c2f749b629ad20d90df33d13355b5797.zip
chromium_src-010152f1c2f749b629ad20d90df33d13355b5797.tar.gz
chromium_src-010152f1c2f749b629ad20d90df33d13355b5797.tar.bz2
[WebModals] New API for browser-scoped popup management.
This interface follows the WebContents-scoped WebContentsModalDialogManager closely, the main difference being the change in scope -- the popup manager is intended to manage popups (bubbles and web-modals) scoped both at the per-WebContents level as well as at the browser/system level. The policy for the manager is not known yet, so this change is setting up the API which will be used to register popups with the manager, and the lifecycle which the manager uses to display them. The critical facts about a popup are expected to be: 1. Whether it is user-initiated. 2. If it is scoped to a particular WebContents (and if so, which one), 3. If it is overlappable. Other important management facts about popups may be added later. The lifecycle operation is all driven through an interface called SinglePopupManager which is a one-per-window scoped manager owned by the PopupManager. These classes take charge of showing and hiding their popups depending on the state of the browser window, as governed by whatever state change observations made by the overall PopupManager relate to its policy. When a window is closed by direct user action, the manager notifies the overall BubbleManager, which then removes the window from the management queue and can show another window. A window may also be closed by direct command from the overall BubbleManager, for example if it is superceded by another user-initiated popup. BUG=375393 TBR=yoz Review URL: https://codereview.chromium.org/287123002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283099 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm')
-rw-r--r--chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm8
1 files changed, 5 insertions, 3 deletions
diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm
index 7e6031b..8fcdeeb 100644
--- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm
+++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm
@@ -11,6 +11,7 @@
#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet.h"
#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.h"
#import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h"
+#include "components/web_modal/popup_manager.h"
#include "components/web_modal/web_contents_modal_dialog_manager.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
@@ -33,9 +34,10 @@ ConstrainedWindowMac::ConstrainedWindowMac(
web_contents_ = web_view_guest && web_view_guest->embedder_web_contents() ?
web_view_guest->embedder_web_contents() : web_contents;
DCHECK(sheet_.get());
- WebContentsModalDialogManager* web_contents_modal_dialog_manager =
- WebContentsModalDialogManager::FromWebContents(web_contents_);
- web_contents_modal_dialog_manager->ShowModalDialog(this);
+ web_modal::PopupManager* popup_manager =
+ web_modal::PopupManager::FromWebContents(web_contents_);
+ if (popup_manager)
+ popup_manager->ShowModalDialog(this, web_contents_);
}
ConstrainedWindowMac::~ConstrainedWindowMac() {