diff options
author | wittman@chromium.org <wittman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-06 05:17:59 +0000 |
---|---|---|
committer | wittman@chromium.org <wittman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-06 05:17:59 +0000 |
commit | a02358d357f618507170daf192a9485e51bbc3c0 (patch) | |
tree | c0059de683878844a86e6a4ede76d7baea8c0174 /components/web_modal/web_contents_modal_dialog_manager.h | |
parent | 5e3484fcaf2acc8f3cf44db4fbb9a75596440d04 (diff) | |
download | chromium_src-a02358d357f618507170daf192a9485e51bbc3c0.zip chromium_src-a02358d357f618507170daf192a9485e51bbc3c0.tar.gz chromium_src-a02358d357f618507170daf192a9485e51bbc3c0.tar.bz2 |
Provide configurable closing of web contents modal dialogs on interstitial webui
Allow individual web contents modal dialog users to specify that dialogs
should be closed when encountering interstitial webui (e.g. due to
SSL warnings).
Future CLs will enable use of this functionality for most dialogs.
BUG=240575
Review URL: https://chromiumcodereview.appspot.com/23981002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221575 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/web_modal/web_contents_modal_dialog_manager.h')
-rw-r--r-- | components/web_modal/web_contents_modal_dialog_manager.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/components/web_modal/web_contents_modal_dialog_manager.h b/components/web_modal/web_contents_modal_dialog_manager.h index 5502c09..eff0e2c 100644 --- a/components/web_modal/web_contents_modal_dialog_manager.h +++ b/components/web_modal/web_contents_modal_dialog_manager.h @@ -47,6 +47,10 @@ class WebContentsModalDialogManager // calling this function. void FocusTopmostDialog(); + // Set to true to close the window when a page load starts on the WebContents. + void SetCloseOnInterstitialWebUI(NativeWebContentsModalDialog dialog, + bool close); + // Overriden from NativeWebContentsModalDialogManagerDelegate: virtual content::WebContents* GetWebContents() const OVERRIDE; // Called when a WebContentsModalDialogs we own is about to be closed. @@ -64,6 +68,7 @@ class WebContentsModalDialogManager : manager_(manager) {} void CloseAllDialogs() { manager_->CloseAllDialogs(); } + void DidAttachInterstitialPage() { manager_->DidAttachInterstitialPage(); } void ResetNativeManager(NativeWebContentsModalDialogManager* delegate) { manager_->native_manager_.reset(delegate); } @@ -78,7 +83,18 @@ class WebContentsModalDialogManager explicit WebContentsModalDialogManager(content::WebContents* web_contents); friend class content::WebContentsUserData<WebContentsModalDialogManager>; - typedef std::deque<NativeWebContentsModalDialog> WebContentsModalDialogList; + struct DialogState { + explicit DialogState(NativeWebContentsModalDialog dialog); + + NativeWebContentsModalDialog dialog; + bool close_on_interstitial_webui; + }; + + typedef std::deque<DialogState> WebContentsModalDialogList; + + // Utility function to get the dialog state for a dialog. + WebContentsModalDialogList::iterator FindDialogState( + NativeWebContentsModalDialog dialog); // Blocks/unblocks interaction with renderer process. void BlockWebContentsInteraction(bool blocked); @@ -94,6 +110,7 @@ class WebContentsModalDialogManager const content::FrameNavigateParams& params) OVERRIDE; virtual void DidGetIgnoredUIEvent() OVERRIDE; virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE; + virtual void DidAttachInterstitialPage() OVERRIDE; // Delegate for notifying our owner about stuff. Not owned by us. WebContentsModalDialogManagerDelegate* delegate_; |