| 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_TAB_MODAL_CONFIRM_DIALOG_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TAB_MODAL_CONFIRM_DIALOG_VIEWS_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TAB_MODAL_CONFIRM_DIALOG_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TAB_MODAL_CONFIRM_DIALOG_VIEWS_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" |
| 10 #include "chrome/browser/ui/tab_modal_confirm_dialog.h" |
| 8 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
| 9 #include "ui/views/window/dialog_delegate.h" | 12 #include "ui/views/window/dialog_delegate.h" |
| 10 | 13 |
| 11 class TabContents; | |
| 12 class TabModalConfirmDialogDelegate; | |
| 13 | |
| 14 namespace views { | 14 namespace views { |
| 15 class MessageBoxView; | 15 class MessageBoxView; |
| 16 } | 16 } |
| 17 | 17 |
| 18 // Displays a tab-modal dialog, i.e. a dialog that will block the current page | 18 // Displays a tab-modal dialog, i.e. a dialog that will block the current page |
| 19 // but still allow the user to switch to a different page. | 19 // but still allow the user to switch to a different page. |
| 20 // To display the dialog, allocate this object on the heap. It will open the | 20 // To display the dialog, allocate this object on the heap. It will open the |
| 21 // dialog from its constructor and then delete itself when the user dismisses | 21 // dialog from its constructor and then delete itself when the user dismisses |
| 22 // the dialog. | 22 // the dialog. |
| 23 class TabModalConfirmDialogViews : public views::DialogDelegate { | 23 class TabModalConfirmDialogViews : public TabModalConfirmDialog, |
| 24 public views::DialogDelegate { |
| 24 public: | 25 public: |
| 25 TabModalConfirmDialogViews(TabModalConfirmDialogDelegate* delegate, | 26 TabModalConfirmDialogViews(TabModalConfirmDialogDelegate* delegate, |
| 26 TabContents* tab_contents); | 27 TabContents* tab_contents); |
| 27 | 28 |
| 28 // views::DialogDelegate: | 29 // views::DialogDelegate: |
| 29 virtual string16 GetWindowTitle() const OVERRIDE; | 30 virtual string16 GetWindowTitle() const OVERRIDE; |
| 30 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; | 31 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; |
| 31 virtual bool Cancel() OVERRIDE; | 32 virtual bool Cancel() OVERRIDE; |
| 32 virtual bool Accept() OVERRIDE; | 33 virtual bool Accept() OVERRIDE; |
| 33 | 34 |
| 34 // views::WidgetDelegate: | 35 // views::WidgetDelegate: |
| 35 virtual views::View* GetContentsView() OVERRIDE; | 36 virtual views::View* GetContentsView() OVERRIDE; |
| 36 virtual views::Widget* GetWidget() OVERRIDE; | 37 virtual views::Widget* GetWidget() OVERRIDE; |
| 37 virtual const views::Widget* GetWidget() const OVERRIDE; | 38 virtual const views::Widget* GetWidget() const OVERRIDE; |
| 38 virtual void DeleteDelegate() OVERRIDE; | 39 virtual void DeleteDelegate() OVERRIDE; |
| 39 | 40 |
| 40 private: | 41 private: |
| 41 virtual ~TabModalConfirmDialogViews(); | 42 virtual ~TabModalConfirmDialogViews(); |
| 42 | 43 |
| 44 // TabModalConfirmDialog: |
| 45 virtual void AcceptTabModalDialog() OVERRIDE; |
| 46 virtual void CancelTabModalDialog() OVERRIDE; |
| 47 |
| 43 scoped_ptr<TabModalConfirmDialogDelegate> delegate_; | 48 scoped_ptr<TabModalConfirmDialogDelegate> delegate_; |
| 44 | 49 |
| 45 // The message box view whose commands we handle. | 50 // The message box view whose commands we handle. |
| 46 views::MessageBoxView* message_box_view_; | 51 views::MessageBoxView* message_box_view_; |
| 47 | 52 |
| 48 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogViews); | 53 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogViews); |
| 49 }; | 54 }; |
| 50 | 55 |
| 51 #endif // CHROME_BROWSER_UI_VIEWS_TAB_MODAL_CONFIRM_DIALOG_VIEWS_H_ | 56 #endif // CHROME_BROWSER_UI_VIEWS_TAB_MODAL_CONFIRM_DIALOG_VIEWS_H_ |
| OLD | NEW |