[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / tab_modal_confirm_dialog_mac.h
blob4ef6fc4b5a6ec1870abd989c2029b3d99efc3610
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;
16 namespace content {
17 class WebContents;
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
27 // the dialog.
28 class TabModalConfirmDialogMac : public TabModalConfirmDialog,
29 public ConstrainedWindowMacDelegate {
30 public:
31 TabModalConfirmDialogMac(TabModalConfirmDialogDelegate* delegate,
32 content::WebContents* web_contents);
34 private:
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;
48 bool closing_;
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_