Chromium Code Reviews| Index: components/web_modal/web_contents_modal_dialog_manager.h |
| diff --git a/components/web_modal/web_contents_modal_dialog_manager.h b/components/web_modal/web_contents_modal_dialog_manager.h |
| index e2548c04e5cfc8b48bef516d9048aefea4f03052..2fc4e31bcef3bea17310ff06a7f6c7f67261755e 100644 |
| --- a/components/web_modal/web_contents_modal_dialog_manager.h |
| +++ b/components/web_modal/web_contents_modal_dialog_manager.h |
| @@ -45,6 +45,11 @@ class WebContentsModalDialogManager |
| // calling this function. |
| void FocusTopmostDialog(); |
| + // Set to true to inhibit closing the window when a page load starts on the |
| + // WebContents. |
| + void SetInhibitCloseOnLoadStart(NativeWebContentsModalDialog dialog, |
|
Ben Goodger (Google)
2013/07/17 16:48:15
SetPreventClose.. ?
Mike Wittman
2013/07/17 17:57:50
sgtm, done.
|
| + bool inhibit); |
| + |
| // Overriden from NativeWebContentsModalDialogManagerDelegate: |
| virtual content::WebContents* GetWebContents() const OVERRIDE; |
| // Called when a WebContentsModalDialogs we own is about to be closed. |
| @@ -76,7 +81,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 inhibit_close_on_load_start; |
| + }; |
| + |
| + 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); |
| @@ -87,9 +103,6 @@ class WebContentsModalDialogManager |
| void CloseAllDialogs(); |
| // Overridden from content::WebContentsObserver: |
| - virtual void DidNavigateMainFrame( |
| - const content::LoadCommittedDetails& details, |
| - const content::FrameNavigateParams& params) OVERRIDE; |
| virtual void DidGetIgnoredUIEvent() OVERRIDE; |
| virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE; |