1 // Copyright 2013 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_WINDOWED_INSTALL_DIALOG_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_WINDOWED_INSTALL_DIALOG_CONTROLLER_H_
8 #import <Cocoa/Cocoa.h>
10 #include "base/gtest_prod_util.h"
11 #include "base/mac/scoped_nsobject.h"
12 #include "chrome/browser/extensions/extension_install_prompt.h"
14 @
class ExtensionInstallViewController
;
15 @
class WindowedInstallController
;
17 // Displays an app or extension install or permissions prompt as a standalone
19 class WindowedInstallDialogController
20 : public ExtensionInstallPrompt::Delegate
{
22 // Initializes the ExtensionInstallViewController and shows the window. This
23 // object will delete itself when the window is closed.
24 WindowedInstallDialogController(
25 const ExtensionInstallPrompt::ShowParams
& show_params
,
26 ExtensionInstallPrompt::Delegate
* delegate
,
27 const ExtensionInstallPrompt::Prompt
& prompt
);
28 virtual ~WindowedInstallDialogController();
30 // Invoked by the -[NSWindow windowWillClose:] notification after a dialog
31 // choice is invoked. Releases owned resources, then deletes |this|.
32 void OnWindowClosing();
34 // ExtensionInstallPrompt::Delegate:
35 virtual void InstallUIProceed() OVERRIDE
;
36 virtual void InstallUIAbort(bool user_initiated
) OVERRIDE
;
39 FRIEND_TEST_ALL_PREFIXES(WindowedInstallDialogControllerBrowserTest
,
41 ExtensionInstallViewController
* GetViewController();
43 ExtensionInstallPrompt::Delegate
* delegate_
;
44 base::scoped_nsobject
<WindowedInstallController
> install_controller_
;
46 DISALLOW_COPY_AND_ASSIGN(WindowedInstallDialogController
);
49 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_WINDOWED_INSTALL_DIALOG_CONTROLLER_H_