| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_COCOA_TAB_MODAL_CONFIRM_DIALOG_MAC_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_TAB_MODAL_CONFIRM_DIALOG_MAC_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_TAB_MODAL_CONFIRM_DIALOG_MAC_H_ | 6 #define CHROME_BROWSER_UI_COCOA_TAB_MODAL_CONFIRM_DIALOG_MAC_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "chrome/browser/ui/cocoa/constrained_window_mac.h" | 11 #include "chrome/browser/ui/cocoa/constrained_window_mac.h" |
| 12 #include "chrome/browser/ui/tab_modal_confirm_dialog.h" |
| 12 | 13 |
| 13 @class ConstrainedWindowAlert; | 14 @class ConstrainedWindowAlert; |
| 14 class TabContents; | 15 class TabContents; |
| 15 class TabModalConfirmDialogDelegate; | 16 class TabModalConfirmDialogDelegate; |
| 16 | 17 |
| 17 // 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 |
| 18 // but still allow the user to switch to a different page. | 19 // but still allow the user to switch to a different page. |
| 19 // 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 |
| 20 // 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 |
| 21 // the dialog. | 22 // the dialog. |
| 22 class TabModalConfirmDialogMac | 23 class TabModalConfirmDialogMac |
| 23 : public ConstrainedWindowMacDelegateSystemSheet { | 24 : public TabModalConfirmDialog, |
| 25 public ConstrainedWindowMacDelegateSystemSheet { |
| 24 public: | 26 public: |
| 25 TabModalConfirmDialogMac(TabModalConfirmDialogDelegate* delegate, | 27 TabModalConfirmDialogMac(TabModalConfirmDialogDelegate* delegate, |
| 26 TabContents* tab_contents); | 28 TabContents* tab_contents); |
| 27 | 29 |
| 28 // ConstrainedWindowDelegateMacSystemSheet methods: | 30 // ConstrainedWindowDelegateMacSystemSheet: |
| 29 virtual void DeleteDelegate() OVERRIDE; | 31 virtual void DeleteDelegate() OVERRIDE; |
| 30 | 32 |
| 31 private: | 33 private: |
| 32 virtual ~TabModalConfirmDialogMac(); | 34 virtual ~TabModalConfirmDialogMac(); |
| 33 | 35 |
| 36 // TabModalConfirmDialog: |
| 37 virtual void AcceptTabModalDialog() OVERRIDE; |
| 38 virtual void CancelTabModalDialog() OVERRIDE; |
| 39 |
| 34 scoped_ptr<TabModalConfirmDialogDelegate> delegate_; | 40 scoped_ptr<TabModalConfirmDialogDelegate> delegate_; |
| 35 | 41 |
| 36 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogMac); | 42 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogMac); |
| 37 }; | 43 }; |
| 38 | 44 |
| 39 @class TabModalConfirmDialogMacBridge2; | 45 @class TabModalConfirmDialogMacBridge2; |
| 40 | 46 |
| 41 // This class is the same as TabModalConfirmDialogMac except that it uses | 47 // This class is the same as TabModalConfirmDialogMac except that it uses |
| 42 // the new constrained window look and feel. | 48 // the new constrained window look and feel. |
| 43 class TabModalConfirmDialogMac2 { | 49 class TabModalConfirmDialogMac2 : public TabModalConfirmDialog { |
| 44 public: | 50 public: |
| 45 TabModalConfirmDialogMac2(TabModalConfirmDialogDelegate* delegate, | 51 TabModalConfirmDialogMac2(TabModalConfirmDialogDelegate* delegate, |
| 46 TabContents* tab_contents); | 52 TabContents* tab_contents); |
| 47 | 53 |
| 48 private: | 54 private: |
| 49 ~TabModalConfirmDialogMac2(); | 55 virtual ~TabModalConfirmDialogMac2(); |
| 56 |
| 57 // TabModalConfirmDialog: |
| 58 virtual void AcceptTabModalDialog() OVERRIDE; |
| 59 virtual void CancelTabModalDialog() OVERRIDE; |
| 50 | 60 |
| 51 scoped_ptr<TabModalConfirmDialogDelegate> delegate_; | 61 scoped_ptr<TabModalConfirmDialogDelegate> delegate_; |
| 52 scoped_nsobject<ConstrainedWindowAlert> alert_; | 62 scoped_nsobject<ConstrainedWindowAlert> alert_; |
| 53 scoped_nsobject<TabModalConfirmDialogMacBridge2> bridge_; | 63 scoped_nsobject<TabModalConfirmDialogMacBridge2> bridge_; |
| 54 | 64 |
| 55 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogMac2); | 65 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogMac2); |
| 56 }; | 66 }; |
| 57 | 67 |
| 58 #endif // CHROME_BROWSER_UI_COCOA_TAB_MODAL_CONFIRM_DIALOG_MAC_H_ | 68 #endif // CHROME_BROWSER_UI_COCOA_TAB_MODAL_CONFIRM_DIALOG_MAC_H_ |
| OLD | NEW |