| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
| 10 | 10 |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "chrome/browser/ui/cocoa/constrained_window_mac.h" | 12 #include "chrome/browser/ui/cocoa/constrained_window_mac.h" |
| 13 | 13 |
| 14 class TabContents; | 14 class TabContents; |
| 15 typedef TabContents TabContentsWrapper; | |
| 16 class TabModalConfirmDialogDelegate; | 15 class TabModalConfirmDialogDelegate; |
| 17 | 16 |
| 18 // 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 |
| 19 // but still allow the user to switch to a different page. | 18 // 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 | 19 // 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 | 20 // dialog from its constructor and then delete itself when the user dismisses |
| 22 // the dialog. | 21 // the dialog. |
| 23 class TabModalConfirmDialogMac | 22 class TabModalConfirmDialogMac |
| 24 : public ConstrainedWindowMacDelegateSystemSheet { | 23 : public ConstrainedWindowMacDelegateSystemSheet { |
| 25 public: | 24 public: |
| 26 TabModalConfirmDialogMac(TabModalConfirmDialogDelegate* delegate, | 25 TabModalConfirmDialogMac(TabModalConfirmDialogDelegate* delegate, |
| 27 TabContentsWrapper* wrapper); | 26 TabContents* tab_contents); |
| 28 | 27 |
| 29 // ConstrainedWindowDelegateMacSystemSheet methods: | 28 // ConstrainedWindowDelegateMacSystemSheet methods: |
| 30 virtual void DeleteDelegate() OVERRIDE; | 29 virtual void DeleteDelegate() OVERRIDE; |
| 31 | 30 |
| 32 private: | 31 private: |
| 33 virtual ~TabModalConfirmDialogMac(); | 32 virtual ~TabModalConfirmDialogMac(); |
| 34 | 33 |
| 35 scoped_ptr<TabModalConfirmDialogDelegate> delegate_; | 34 scoped_ptr<TabModalConfirmDialogDelegate> delegate_; |
| 36 | 35 |
| 37 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogMac); | 36 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogMac); |
| 38 }; | 37 }; |
| 39 | 38 |
| 40 #endif // CHROME_BROWSER_UI_COCOA_TAB_MODAL_CONFIRM_DIALOG_MAC_H_ | 39 #endif // CHROME_BROWSER_UI_COCOA_TAB_MODAL_CONFIRM_DIALOG_MAC_H_ |
| OLD | NEW |