Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3553)

Unified Diff: chrome/browser/views/jsmessage_box_dialog.h

Issue 63033: Refactor AppModalDialogQueue and move JS Alert boxes into a MVC. (Closed)
Patch Set: whitespace Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/views/browser_views.vcproj ('k') | chrome/browser/views/jsmessage_box_dialog.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/jsmessage_box_dialog.h
diff --git a/chrome/browser/views/jsmessage_box_dialog.h b/chrome/browser/views/jsmessage_box_dialog.h
new file mode 100644
index 0000000000000000000000000000000000000000..7195904b01bbe55079d9d9e40f654b266fffd8a4
--- /dev/null
+++ b/chrome/browser/views/jsmessage_box_dialog.h
@@ -0,0 +1,64 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_VIEWS_JSMESSAGE_BOX_DIALOG_H_
+#define CHROME_BROWSER_VIEWS_JSMESSAGE_BOX_DIALOG_H_
+
+#include <string>
+
+#include "chrome/browser/app_modal_dialog.h"
+#include "chrome/views/window/dialog_delegate.h"
+
+class MessageBoxView;
+class WebContents;
+namespace views {
+class Window;
+}
+
+class JavascriptMessageBoxDialog : public views::DialogDelegate {
+ public:
+ JavascriptMessageBoxDialog(AppModalDialog* parent,
+ const std::wstring& message_text,
+ const std::wstring& default_prompt_text,
+ bool display_suppress_checkbox);
+
+ virtual ~JavascriptMessageBoxDialog();
+
+ // Methods called from AppModalDialog.
+ void ShowModalDialog();
+ void ActivateModalDialog();
+ void CloseModalDialog();
+
+ // views::DialogDelegate Methods:
+ virtual int GetDialogButtons() const;
+ virtual std::wstring GetWindowTitle() const;
+ virtual void WindowClosing();
+ virtual void DeleteDelegate();
+ virtual bool Cancel();
+ virtual bool Accept();
+ virtual std::wstring GetDialogButtonLabel(DialogButton button) const;
+
+ // views::WindowDelegate Methods:
+ virtual bool IsModal() const { return true; }
+ virtual views::View* GetContentsView();
+ virtual views::View* GetInitiallyFocusedView();
+
+ private:
+ WebContents* web_contents() {
+ return parent_->web_contents();
+ }
+
+ // A pointer to the AppModalDialog that owns us.
+ AppModalDialog* parent_;
+
+ // The message box view whose commands we handle.
+ MessageBoxView* message_box_view_;
+
+ // The dialog if it is currently visible.
+ views::Window* dialog_;
+
+ DISALLOW_COPY_AND_ASSIGN(JavascriptMessageBoxDialog);
+};
+
+#endif // CHROME_BROWSER_VIEWS_JSMESSAGE_BOX_DIALOG_H_
« no previous file with comments | « chrome/browser/views/browser_views.vcproj ('k') | chrome/browser/views/jsmessage_box_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698