summaryrefslogtreecommitdiffstats
path: root/chrome/browser/app_modal_dialog_queue.h
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-16 22:41:42 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-16 22:41:42 +0000
commitb6ad1cab92ed9e9c1734d1801482cfa8ffd3b4b1 (patch)
tree0d1a8598536ed29830e4e8a4cdbcd90b5f0dbd87 /chrome/browser/app_modal_dialog_queue.h
parent16f3bd95e3f2bd39f6d64f91326bb3cdf894cedc (diff)
downloadchromium_src-b6ad1cab92ed9e9c1734d1801482cfa8ffd3b4b1.zip
chromium_src-b6ad1cab92ed9e9c1734d1801482cfa8ffd3b4b1.tar.gz
chromium_src-b6ad1cab92ed9e9c1734d1801482cfa8ffd3b4b1.tar.bz2
Pull app modal dialog handling out of the BrowserList to remove the ChromeViews dependency. (Required for porting).
TEST=Open two browser windows. In one, enter "javascript:alert('Foo');" into the address bar and hit enter. Click on the other window. The modal dialog should be focused and the window it was opened over should flash in the taskbar, Review URL: http://codereview.chromium.org/18179 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8234 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/app_modal_dialog_queue.h')
-rw-r--r--chrome/browser/app_modal_dialog_queue.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/app_modal_dialog_queue.h b/chrome/browser/app_modal_dialog_queue.h
index d1748a1..ff1b5f5 100644
--- a/chrome/browser/app_modal_dialog_queue.h
+++ b/chrome/browser/app_modal_dialog_queue.h
@@ -39,6 +39,16 @@ class AppModalDialogQueue {
// this condition).
static void ActivateModalDialog();
+ // Returns true if there is currently an active app modal dialog box.
+ static bool HasActiveDialog() {
+ return active_dialog_ != NULL;
+ }
+
+ // Accessor for |active_dialog_|.
+ static views::AppModalDialogDelegate* active_dialog() {
+ return active_dialog_;
+ }
+
private:
// Shows |dialog| and notifies the BrowserList that a modal dialog is showing.
static void ShowModalDialog(views::AppModalDialogDelegate* dialog);
@@ -47,6 +57,10 @@ class AppModalDialogQueue {
// currently modal dialog at the front of the queue.
static std::queue<views::AppModalDialogDelegate*>*
app_modal_dialog_queue_;
+
+ // The currently active app-modal dialog box's delegate. NULL if there is no
+ // active app-modal dialog box.
+ static views::AppModalDialogDelegate* active_dialog_;
};
#endif // CHROME_BROWSER_APP_MODAL_DIALOG_QUEUE_H__