| Index: chrome/browser/ui/web_contents_modal_dialog_manager.h
|
| diff --git a/chrome/browser/ui/constrained_window_tab_helper.h b/chrome/browser/ui/web_contents_modal_dialog_manager.h
|
| similarity index 49%
|
| rename from chrome/browser/ui/constrained_window_tab_helper.h
|
| rename to chrome/browser/ui/web_contents_modal_dialog_manager.h
|
| index f62176dcaf1bcc555a00b3ddef7e3ea7b5b46ffa..10bb91d13eaca1a060708a313b59f95a76ac9d24 100644
|
| --- a/chrome/browser/ui/constrained_window_tab_helper.h
|
| +++ b/chrome/browser/ui/web_contents_modal_dialog_manager.h
|
| @@ -2,58 +2,58 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CHROME_BROWSER_UI_CONSTRAINED_WINDOW_TAB_HELPER_H_
|
| -#define CHROME_BROWSER_UI_CONSTRAINED_WINDOW_TAB_HELPER_H_
|
| +#ifndef CHROME_BROWSER_UI_WEB_CONTENTS_MODAL_DIALOG_MANAGER_H_
|
| +#define CHROME_BROWSER_UI_WEB_CONTENTS_MODAL_DIALOG_MANAGER_H_
|
|
|
| #include <deque>
|
|
|
| #include "content/public/browser/web_contents_observer.h"
|
| #include "content/public/browser/web_contents_user_data.h"
|
|
|
| -class ConstrainedWindow;
|
| -class ConstrainedWindowTabHelperDelegate;
|
| +class WebContentsModalDialog;
|
| +class WebContentsModalDialogManagerDelegate;
|
|
|
| -// Per-tab class to manage constrained windows.
|
| -class ConstrainedWindowTabHelper
|
| +// Per-WebContents class to manage WebContents-modal dialogs.
|
| +class WebContentsModalDialogManager
|
| : public content::WebContentsObserver,
|
| - public content::WebContentsUserData<ConstrainedWindowTabHelper> {
|
| + public content::WebContentsUserData<WebContentsModalDialogManager> {
|
| public:
|
| - virtual ~ConstrainedWindowTabHelper();
|
| + virtual ~WebContentsModalDialogManager();
|
|
|
| - ConstrainedWindowTabHelperDelegate* delegate() const { return delegate_; }
|
| - void set_delegate(ConstrainedWindowTabHelperDelegate* d) { delegate_ = d; }
|
| + WebContentsModalDialogManagerDelegate* delegate() const { return delegate_; }
|
| + void set_delegate(WebContentsModalDialogManagerDelegate* d) { delegate_ = d; }
|
|
|
| - // Adds the given window to the list of child windows. The window will notify
|
| + // Adds the given dialog to the list of child dialogs. The dialog will notify
|
| // via WillClose() when it is being destroyed.
|
| - void AddDialog(ConstrainedWindow* window);
|
| + void AddDialog(WebContentsModalDialog* dialog);
|
|
|
| // Closes all WebContentsModalDialogs.
|
| void CloseAllDialogs();
|
|
|
| // Called when a WebContentsModalDialogs we own is about to be closed.
|
| - void WillClose(ConstrainedWindow* window);
|
| + void WillClose(WebContentsModalDialog* dialog);
|
|
|
| // Blocks/unblocks interaction with renderer process.
|
| void BlockWebContentsInteraction(bool blocked);
|
|
|
| - // Returns the number of constrained windows in this tab.
|
| + // Returns the number of dialogs in this tab.
|
| size_t dialog_count() { return child_dialogs_.size(); }
|
|
|
| - typedef std::deque<ConstrainedWindow*> WebContentsModalDialogList;
|
| + typedef std::deque<WebContentsModalDialog*> WebContentsModalDialogList;
|
|
|
| - // Return an iterator for the first constrained window in this web contents.
|
| + // Return an iterator for the first dialog in this web contents.
|
| WebContentsModalDialogList::iterator dialog_begin() {
|
| return child_dialogs_.begin();
|
| }
|
|
|
| - // Return an iterator for the last constrained window in this web contents.
|
| + // Return an iterator for the last dialog in this web contents.
|
| WebContentsModalDialogList::iterator dialog_end() {
|
| return child_dialogs_.end();
|
| }
|
|
|
| private:
|
| - explicit ConstrainedWindowTabHelper(content::WebContents* web_contents);
|
| - friend class content::WebContentsUserData<ConstrainedWindowTabHelper>;
|
| + explicit WebContentsModalDialogManager(content::WebContents* web_contents);
|
| + friend class content::WebContentsUserData<WebContentsModalDialogManager>;
|
|
|
| // Overridden from content::WebContentsObserver:
|
| virtual void DidNavigateMainFrame(
|
| @@ -63,12 +63,12 @@ class ConstrainedWindowTabHelper
|
| virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE;
|
|
|
| // Delegate for notifying our owner about stuff. Not owned by us.
|
| - ConstrainedWindowTabHelperDelegate* delegate_;
|
| + WebContentsModalDialogManagerDelegate* delegate_;
|
|
|
| - // All active constrained windows.
|
| + // All active dialogs.
|
| WebContentsModalDialogList child_dialogs_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowTabHelper);
|
| + DISALLOW_COPY_AND_ASSIGN(WebContentsModalDialogManager);
|
| };
|
|
|
| -#endif // CHROME_BROWSER_UI_CONSTRAINED_WINDOW_TAB_HELPER_H_
|
| +#endif // CHROME_BROWSER_UI_WEB_CONTENTS_MODAL_DIALOG_MANAGER_H_
|
|
|