| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_JAVASCRIPT_APP_MODAL_DIALOG_VIEWS_H_ | 5 #ifndef COMPONENTS_APP_MODAL_DIALOGS_VIEWS_JAVASCRIPT_APP_MODAL_DIALOG_VIEWS_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_JAVASCRIPT_APP_MODAL_DIALOG_VIEWS_H_ | 6 #define COMPONENTS_APP_MODAL_DIALOGS_VIEWS_JAVASCRIPT_APP_MODAL_DIALOG_VIEWS_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "components/app_modal_dialogs/native_app_modal_dialog.h" | 9 #include "components/app_modal_dialogs/native_app_modal_dialog.h" |
| 10 #include "ui/views/window/dialog_delegate.h" | 10 #include "ui/views/window/dialog_delegate.h" |
| 11 | 11 |
| 12 class JavaScriptAppModalDialog; | 12 class JavaScriptAppModalDialog; |
| 13 | 13 |
| 14 #if defined(USE_X11) && !defined(OS_CHROMEOS) | |
| 15 class JavascriptAppModalEventBlockerX11; | |
| 16 #endif | |
| 17 | |
| 18 namespace views { | 14 namespace views { |
| 19 class MessageBoxView; | 15 class MessageBoxView; |
| 20 } | 16 } |
| 21 | 17 |
| 22 class JavaScriptAppModalDialogViews : public NativeAppModalDialog, | 18 class JavaScriptAppModalDialogViews : public NativeAppModalDialog, |
| 23 public views::DialogDelegate { | 19 public views::DialogDelegate { |
| 24 public: | 20 public: |
| 25 explicit JavaScriptAppModalDialogViews(JavaScriptAppModalDialog* parent); | 21 explicit JavaScriptAppModalDialogViews(JavaScriptAppModalDialog* parent); |
| 26 ~JavaScriptAppModalDialogViews() override; | 22 ~JavaScriptAppModalDialogViews() override; |
| 27 | 23 |
| 28 // Overridden from NativeAppModalDialog: | 24 // Overridden from NativeAppModalDialog: |
| 29 int GetAppModalDialogButtons() const override; | 25 int GetAppModalDialogButtons() const override; |
| 30 void ShowAppModalDialog() override; | 26 void ShowAppModalDialog() override; |
| 31 void ActivateAppModalDialog() override; | 27 void ActivateAppModalDialog() override; |
| 32 void CloseAppModalDialog() override; | 28 void CloseAppModalDialog() override; |
| 33 void AcceptAppModalDialog() override; | 29 void AcceptAppModalDialog() override; |
| 34 void CancelAppModalDialog() override; | 30 void CancelAppModalDialog() override; |
| 35 | 31 |
| 36 // Overridden from views::DialogDelegate: | 32 // Overridden from views::DialogDelegate: |
| 37 int GetDefaultDialogButton() const override; | 33 int GetDefaultDialogButton() const override; |
| 38 int GetDialogButtons() const override; | 34 int GetDialogButtons() const override; |
| 39 base::string16 GetWindowTitle() const override; | 35 base::string16 GetWindowTitle() const override; |
| 40 void WindowClosing() override; | |
| 41 void DeleteDelegate() override; | 36 void DeleteDelegate() override; |
| 42 bool Cancel() override; | 37 bool Cancel() override; |
| 43 bool Accept() override; | 38 bool Accept() override; |
| 44 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | 39 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; |
| 45 | 40 |
| 46 // Overridden from views::WidgetDelegate: | 41 // Overridden from views::WidgetDelegate: |
| 47 ui::ModalType GetModalType() const override; | 42 ui::ModalType GetModalType() const override; |
| 48 views::View* GetContentsView() override; | 43 views::View* GetContentsView() override; |
| 49 views::View* GetInitiallyFocusedView() override; | 44 views::View* GetInitiallyFocusedView() override; |
| 50 void OnClosed() override; | 45 void OnClosed() override; |
| 51 views::Widget* GetWidget() override; | 46 views::Widget* GetWidget() override; |
| 52 const views::Widget* GetWidget() const override; | 47 const views::Widget* GetWidget() const override; |
| 53 | 48 |
| 54 private: | 49 private: |
| 55 // A pointer to the AppModalDialog that owns us. | 50 // A pointer to the AppModalDialog that owns us. |
| 56 scoped_ptr<JavaScriptAppModalDialog> parent_; | 51 scoped_ptr<JavaScriptAppModalDialog> parent_; |
| 57 | 52 |
| 58 // The message box view whose commands we handle. | 53 // The message box view whose commands we handle. |
| 59 views::MessageBoxView* message_box_view_; | 54 views::MessageBoxView* message_box_view_; |
| 60 | 55 |
| 61 #if defined(USE_X11) && !defined(OS_CHROMEOS) | |
| 62 // Blocks events to other browser windows while the dialog is open. | |
| 63 scoped_ptr<JavascriptAppModalEventBlockerX11> event_blocker_x11_; | |
| 64 #endif | |
| 65 | |
| 66 DISALLOW_COPY_AND_ASSIGN(JavaScriptAppModalDialogViews); | 56 DISALLOW_COPY_AND_ASSIGN(JavaScriptAppModalDialogViews); |
| 67 }; | 57 }; |
| 68 | 58 |
| 69 #endif // CHROME_BROWSER_UI_VIEWS_JAVASCRIPT_APP_MODAL_DIALOG_VIEWS_H_ | 59 #endif // COMPONENTS_APP_MODAL_DIALOGS_VIEWS_JAVASCRIPT_APP_MODAL_DIALOG_VIEWS_
H_ |
| OLD | NEW |