OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_VIEWS_JSMESSAGE_BOX_DIALOG_H_ |
| 6 #define CHROME_BROWSER_VIEWS_JSMESSAGE_BOX_DIALOG_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "chrome/browser/app_modal_dialog.h" |
| 11 #include "chrome/views/window/dialog_delegate.h" |
| 12 |
| 13 class MessageBoxView; |
| 14 class WebContents; |
| 15 namespace views { |
| 16 class Window; |
| 17 } |
| 18 |
| 19 class JavascriptMessageBoxDialog : public views::DialogDelegate { |
| 20 public: |
| 21 JavascriptMessageBoxDialog(AppModalDialog* parent, |
| 22 const std::wstring& message_text, |
| 23 const std::wstring& default_prompt_text, |
| 24 bool display_suppress_checkbox); |
| 25 |
| 26 virtual ~JavascriptMessageBoxDialog(); |
| 27 |
| 28 // Methods called from AppModalDialog. |
| 29 void ShowModalDialog(); |
| 30 void ActivateModalDialog(); |
| 31 void CloseModalDialog(); |
| 32 |
| 33 // views::DialogDelegate Methods: |
| 34 virtual int GetDialogButtons() const; |
| 35 virtual std::wstring GetWindowTitle() const; |
| 36 virtual void WindowClosing(); |
| 37 virtual void DeleteDelegate(); |
| 38 virtual bool Cancel(); |
| 39 virtual bool Accept(); |
| 40 virtual std::wstring GetDialogButtonLabel(DialogButton button) const; |
| 41 |
| 42 // views::WindowDelegate Methods: |
| 43 virtual bool IsModal() const { return true; } |
| 44 virtual views::View* GetContentsView(); |
| 45 virtual views::View* GetInitiallyFocusedView(); |
| 46 |
| 47 private: |
| 48 WebContents* web_contents() { |
| 49 return parent_->web_contents(); |
| 50 } |
| 51 |
| 52 // A pointer to the AppModalDialog that owns us. |
| 53 AppModalDialog* parent_; |
| 54 |
| 55 // The message box view whose commands we handle. |
| 56 MessageBoxView* message_box_view_; |
| 57 |
| 58 // The dialog if it is currently visible. |
| 59 views::Window* dialog_; |
| 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(JavascriptMessageBoxDialog); |
| 62 }; |
| 63 |
| 64 #endif // CHROME_BROWSER_VIEWS_JSMESSAGE_BOX_DIALOG_H_ |
OLD | NEW |