[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / extensions / extension_install_dialog_controller.h
blob18478abaa4f106e4d48d588d0a9ee798cab82cae
1 // Copyright (c) 2012 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_EXTENSIONS_EXTENSION_INSTALL_DIALOG_CONTROLER_H_
6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_DIALOG_CONTROLER_H_
8 #import <Cocoa/Cocoa.h>
10 #include "base/mac/scoped_nsobject.h"
11 #include "chrome/browser/extensions/extension_install_prompt.h"
12 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h"
14 namespace content {
15 class PageNavigator;
16 class WebContents;
19 @class ExtensionInstallViewController;
21 // Displays an extension install prompt as a tab modal dialog.
22 class ExtensionInstallDialogController :
23 public ExtensionInstallPrompt::Delegate,
24 public ConstrainedWindowMacDelegate {
25 public:
26 ExtensionInstallDialogController(
27 const ExtensionInstallPrompt::ShowParams& show_params,
28 ExtensionInstallPrompt::Delegate* delegate,
29 const ExtensionInstallPrompt::Prompt& prompt);
30 virtual ~ExtensionInstallDialogController();
32 // ExtensionInstallPrompt::Delegate implementation.
33 virtual void InstallUIProceed() OVERRIDE;
34 virtual void InstallUIAbort(bool user_initiated) OVERRIDE;
36 // ConstrainedWindowMacDelegate implementation.
37 virtual void OnConstrainedWindowClosed(
38 ConstrainedWindowMac* window) OVERRIDE;
40 ConstrainedWindowMac* constrained_window() const {
41 return constrained_window_.get();
43 ExtensionInstallViewController* view_controller() const {
44 return view_controller_;
47 private:
48 ExtensionInstallPrompt::Delegate* delegate_;
49 base::scoped_nsobject<ExtensionInstallViewController> view_controller_;
50 scoped_ptr<ConstrainedWindowMac> constrained_window_;
53 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_DIALOG_CONTROLLER_H_