diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-05 00:37:20 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-05 00:37:20 +0000 |
commit | fad84eab5e64996804824f2c7b8fce98da13b2cd (patch) | |
tree | 2fce4e91880f94c3e94687e9c0521586c37fa916 /chrome/browser/browser_list.h | |
parent | 792e3c941a74c48db7454a945260a0e8b288ffce (diff) | |
download | chromium_src-fad84eab5e64996804824f2c7b8fce98da13b2cd.zip chromium_src-fad84eab5e64996804824f2c7b8fce98da13b2cd.tar.gz chromium_src-fad84eab5e64996804824f2c7b8fce98da13b2cd.tar.bz2 |
Adding the capacity to interact with modal dialogs to the automation framework.
This change will be used by Ojan to implement some unload handler tests.
TEST=Run the ui tests.
Review URL: http://codereview.chromium.org/13113
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6402 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_list.h')
-rw-r--r-- | chrome/browser/browser_list.h | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/chrome/browser/browser_list.h b/chrome/browser/browser_list.h index ef9a16f..f9d76c3 100644 --- a/chrome/browser/browser_list.h +++ b/chrome/browser/browser_list.h @@ -11,6 +11,7 @@ #include "chrome/browser/browser.h" namespace views { +class AppModalDialogDelegate; class Window; }; class WebContents; @@ -76,30 +77,9 @@ class BrowserList { // Returns true if there is at least one Browser with the specified profile. static bool HasBrowserWithProfile(Profile* profile); - // Set whether the last active browser should be modal or not, if - // |is_app_modal| is true, the last active browser window will be activated - // and brought to the front whenever the user attempts to activate any other - // browser window. If |is_app_modal| is false all window activation works as - // normal. SetIsShowingAppModalDialog should not be called with |is_app_modal| - // set to true if the last active browser is already modal. - // - // TODO(devint): http://b/issue?id=1123402 Application modal dialogs aren't - // selected, just the last active browser. Therefore, to properly use this - // function we have to set the modal dialog as a child of a browser, - // activate that browser window, call SetIsShowingAppModalDialog(true), and - // implement the modal dialog as window modal to its parent. This still isn't - // perfect,however, because it just assures that the browser is activated, and - // the dialog will be on top of that browser, but inactive. It will activate - // if the users attempts to interact with its parent window (the browser). - // Ideally we should activate the modal dialog, not just its parent browser. - // - // There is probably a less clunky way overall to implement application - // modality. Currently, if IsShowingAppModalDialog returns true, we handle - // messages right before the browser activates, and activate whatever - // GetLastActive() returns instead of whatever was trying to be activated. - // It'd be better if we could use built in OS modality handling to deal with - // this, but Windows only supports system modal or parent window modal. - static void SetIsShowingAppModalDialog(bool is_app_modal); + // Sets the passed dialog delegate as the currently showing dialog. + static void SetShowingAppModalDialog(views::AppModalDialogDelegate* dialog); + static views::AppModalDialogDelegate* GetShowingAppModalDialog(); // True if the last active browser is application modal, false otherwise. See // SetIsShowingAppModalDialog for more details. @@ -153,8 +133,8 @@ class BrowserList { typedef std::vector<views::Window*> DependentWindowList; static DependentWindowList dependent_windows_; - // True if last_active_ is app modal, false otherwise. - static bool is_app_modal_; + // Set to the currently showing modal dialog delegate if any, NULL otherwise. + static views::AppModalDialogDelegate* app_modal_dialog_; }; |