Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / extensions / extension_install_dialog_controller.h
blob6a99ef0b1bf614bb053955a15f61bc6b59d50746
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 namespace extensions {
20 class ExperienceSamplingEvent;
23 class ExtensionInstallPromptShowParams;
24 @class ExtensionInstallViewController;
26 // Displays an extension install prompt as a tab modal dialog.
27 class ExtensionInstallDialogController :
28 public ExtensionInstallPrompt::Delegate,
29 public ConstrainedWindowMacDelegate {
30 public:
31 ExtensionInstallDialogController(
32 ExtensionInstallPromptShowParams* show_params,
33 ExtensionInstallPrompt::Delegate* delegate,
34 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt);
35 ~ExtensionInstallDialogController() override;
37 // ExtensionInstallPrompt::Delegate implementation.
38 void InstallUIProceed() override;
39 void InstallUIAbort(bool user_initiated) override;
41 // ConstrainedWindowMacDelegate implementation.
42 void OnConstrainedWindowClosed(ConstrainedWindowMac* window) override;
44 ConstrainedWindowMac* constrained_window() const {
45 return constrained_window_.get();
47 ExtensionInstallViewController* view_controller() const {
48 return view_controller_;
51 private:
52 ExtensionInstallPrompt::Delegate* delegate_;
53 base::scoped_nsobject<ExtensionInstallViewController> view_controller_;
54 scoped_ptr<ConstrainedWindowMac> constrained_window_;
55 scoped_ptr<extensions::ExperienceSamplingEvent> sampling_event_;
58 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_DIALOG_CONTROLLER_H_