summaryrefslogtreecommitdiffstats
path: root/chrome/browser/app_modal_dialog_queue.h
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-07 20:18:28 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-07 20:18:28 +0000
commit0bfa713f7ae0bd154e7a0246413561de64d8c84d (patch)
tree1eb0198e7a91815be2a8cc7007b53b11e241e6fe /chrome/browser/app_modal_dialog_queue.h
parent70771b35915b066928ac79c8a5ba4b950e4d74ec (diff)
downloadchromium_src-0bfa713f7ae0bd154e7a0246413561de64d8c84d.zip
chromium_src-0bfa713f7ae0bd154e7a0246413561de64d8c84d.tar.gz
chromium_src-0bfa713f7ae0bd154e7a0246413561de64d8c84d.tar.bz2
Refactor AppModalDialogQueue and move JS Alert boxes into a MVC.
JavascriptMessageBoxHandler (handles alert, confirm, prompt, and onbeforeunload) was a views class. This change converts it into an MVC so we can port to linux/mac. AppModalDialog is the model+controller, JavascriptMessageBoxDialog is the windows specific view. The onbeforeunload dialog (JavascriptBeforeUnloadHandler) was a subclass of JavascriptMessageBoxHandler that had a different title and button text. I merged this class into JavascriptMessageBoxHandler by passing a bool to handle the custom button text. Review URL: http://codereview.chromium.org/63033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13276 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/app_modal_dialog_queue.h')
-rw-r--r--chrome/browser/app_modal_dialog_queue.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/chrome/browser/app_modal_dialog_queue.h b/chrome/browser/app_modal_dialog_queue.h
index 2482d5a..bfe755c 100644
--- a/chrome/browser/app_modal_dialog_queue.h
+++ b/chrome/browser/app_modal_dialog_queue.h
@@ -7,9 +7,9 @@
#include <queue>
-#include "chrome/views/window/app_modal_dialog_delegate.h"
+#include "chrome/browser/app_modal_dialog.h"
-// Keeps a queue of AppModalDialogDelegates, making sure only one app modal
+// Keeps a queue of AppModalDialogs, making sure only one app modal
// dialog is shown at a time.
class AppModalDialogQueue {
public:
@@ -21,9 +21,9 @@ class AppModalDialogQueue {
// assure it is the child of BrowserList::GetLastActive() so that it is
// activated as well. See browser_list.h for more notes about our somewhat
// sloppy app modality.
- // Note: The AppModalDialogDelegate |dialog| must be window modal before it
+ // Note: The AppModalDialog |dialog| must be window modal before it
// can be added as app modal.
- static void AddDialog(views::AppModalDialogDelegate* dialog);
+ static void AddDialog(AppModalDialog* dialog);
// Removes the current dialog in the queue (the one that is being shown).
// Shows the next dialog in the queue, if any is present. This does not
@@ -45,22 +45,21 @@ class AppModalDialogQueue {
}
// Accessor for |active_dialog_|.
- static views::AppModalDialogDelegate* active_dialog() {
+ static AppModalDialog* active_dialog() {
return active_dialog_;
}
private:
// Shows |dialog| and notifies the BrowserList that a modal dialog is showing.
- static void ShowModalDialog(views::AppModalDialogDelegate* dialog);
+ static void ShowModalDialog(AppModalDialog* dialog);
// Contains all app modal dialogs which are waiting to be shown, with the
// currently modal dialog at the front of the queue.
- static std::queue<views::AppModalDialogDelegate*>*
- app_modal_dialog_queue_;
+ static std::queue<AppModalDialog*>* 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_;
+ static AppModalDialog* active_dialog_;
};
#endif // CHROME_BROWSER_APP_MODAL_DIALOG_QUEUE_H__