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 | 12 |
| 13 @class ConstrainedWindowAlert; |
13 class TabContents; | 14 class TabContents; |
14 class TabModalConfirmDialogDelegate; | 15 class TabModalConfirmDialogDelegate; |
15 | 16 |
16 // Displays a tab-modal dialog, i.e. a dialog that will block the current page | 17 // Displays a tab-modal dialog, i.e. a dialog that will block the current page |
17 // but still allow the user to switch to a different page. | 18 // but still allow the user to switch to a different page. |
18 // To display the dialog, allocate this object on the heap. It will open the | 19 // To display the dialog, allocate this object on the heap. It will open the |
19 // dialog from its constructor and then delete itself when the user dismisses | 20 // dialog from its constructor and then delete itself when the user dismisses |
20 // the dialog. | 21 // the dialog. |
21 class TabModalConfirmDialogMac | 22 class TabModalConfirmDialogMac |
22 : public ConstrainedWindowMacDelegateSystemSheet { | 23 : public ConstrainedWindowMacDelegateSystemSheet { |
23 public: | 24 public: |
24 TabModalConfirmDialogMac(TabModalConfirmDialogDelegate* delegate, | 25 TabModalConfirmDialogMac(TabModalConfirmDialogDelegate* delegate, |
25 TabContents* tab_contents); | 26 TabContents* tab_contents); |
26 | 27 |
27 // ConstrainedWindowDelegateMacSystemSheet methods: | 28 // ConstrainedWindowDelegateMacSystemSheet methods: |
28 virtual void DeleteDelegate() OVERRIDE; | 29 virtual void DeleteDelegate() OVERRIDE; |
29 | 30 |
30 private: | 31 private: |
31 virtual ~TabModalConfirmDialogMac(); | 32 virtual ~TabModalConfirmDialogMac(); |
32 | 33 |
33 scoped_ptr<TabModalConfirmDialogDelegate> delegate_; | 34 scoped_ptr<TabModalConfirmDialogDelegate> delegate_; |
34 | 35 |
35 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogMac); | 36 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogMac); |
36 }; | 37 }; |
37 | 38 |
| 39 @class TabModalConfirmDialogMacBridge2; |
| 40 |
| 41 class TabModalConfirmDialogMac2 { |
| 42 public: |
| 43 TabModalConfirmDialogMac2(TabModalConfirmDialogDelegate* delegate, |
| 44 TabContents* tab_contents); |
| 45 |
| 46 private: |
| 47 ~TabModalConfirmDialogMac2(); |
| 48 |
| 49 scoped_ptr<TabModalConfirmDialogDelegate> delegate_; |
| 50 scoped_nsobject<ConstrainedWindowAlert> alert_; |
| 51 scoped_nsobject<TabModalConfirmDialogMacBridge2> bridge_; |
| 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogMac2); |
| 54 }; |
| 55 |
38 #endif // CHROME_BROWSER_UI_COCOA_TAB_MODAL_CONFIRM_DIALOG_MAC_H_ | 56 #endif // CHROME_BROWSER_UI_COCOA_TAB_MODAL_CONFIRM_DIALOG_MAC_H_ |
OLD | NEW |