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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_COCOA_TAB_MODAL_CONFIRM_DIALOG_MAC_H_
6 #define CHROME_BROWSER_UI_COCOA_TAB_MODAL_CONFIRM_DIALOG_MAC_H_
8 #import <Cocoa/Cocoa.h>
10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h"
12 #include "chrome/browser/ui/tab_modal_confirm_dialog.h"
14 @
class ConstrainedWindowAlert
;
20 class TabModalConfirmDialogDelegate
;
21 @
class TabModalConfirmDialogMacBridge
;
23 // Displays a tab-modal dialog, i.e. a dialog that will block the current page
24 // but still allow the user to switch to a different page.
25 // To display the dialog, allocate this object on the heap. It will open the
26 // dialog from its constructor and then delete itself when the user dismisses
28 class TabModalConfirmDialogMac
: public TabModalConfirmDialog
,
29 public ConstrainedWindowMacDelegate
{
31 TabModalConfirmDialogMac(TabModalConfirmDialogDelegate
* delegate
,
32 content::WebContents
* web_contents
);
35 virtual ~TabModalConfirmDialogMac();
37 // TabModalConfirmDialog:
38 virtual void AcceptTabModalDialog() OVERRIDE
;
39 virtual void CancelTabModalDialog() OVERRIDE
;
41 // TabModalConfirmDialogCloseDelegate:
42 virtual void CloseDialog() OVERRIDE
;
44 // ConstrainedWindowMacDelegate:
45 virtual void OnConstrainedWindowClosed(
46 ConstrainedWindowMac
* window
) OVERRIDE
;
50 scoped_ptr
<ConstrainedWindowMac
> window_
;
51 scoped_ptr
<TabModalConfirmDialogDelegate
> delegate_
;
52 base::scoped_nsobject
<ConstrainedWindowAlert
> alert_
;
53 base::scoped_nsobject
<TabModalConfirmDialogMacBridge
> bridge_
;
55 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogMac
);
58 #endif // CHROME_BROWSER_UI_COCOA_TAB_MODAL_CONFIRM_DIALOG_MAC_H_