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 #import "base/mac/scoped_nsobject.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h"
13 #include "chrome/browser/ui/tab_modal_confirm_dialog.h"
15 @
class ConstrainedWindowAlert
;
21 class TabModalConfirmDialogDelegate
;
22 @
class TabModalConfirmDialogMacBridge
;
24 // Displays a tab-modal dialog, i.e. a dialog that will block the current page
25 // but still allow the user to switch to a different page.
26 // To display the dialog, allocate this object on the heap. It will open the
27 // dialog from its constructor and then delete itself when the user dismisses
29 class TabModalConfirmDialogMac
: public TabModalConfirmDialog
,
30 public ConstrainedWindowMacDelegate
{
32 TabModalConfirmDialogMac(TabModalConfirmDialogDelegate
* delegate
,
33 content::WebContents
* web_contents
);
36 ~TabModalConfirmDialogMac() override
;
38 // TabModalConfirmDialog:
39 void AcceptTabModalDialog() override
;
40 void CancelTabModalDialog() override
;
42 // TabModalConfirmDialogCloseDelegate:
43 void CloseDialog() override
;
45 // ConstrainedWindowMacDelegate:
46 void OnConstrainedWindowClosed(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_