| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_WINDOWED_INSTALL_DIALOG_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_WINDOWED_INSTALL_DIALOG_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_WINDOWED_INSTALL_DIALOG_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_WINDOWED_INSTALL_DIALOG_CONTROLLER_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| 11 #include "base/mac/scoped_nsobject.h" | 11 #include "base/mac/scoped_nsobject.h" |
| 12 #include "chrome/browser/extensions/extension_install_prompt.h" | 12 #include "chrome/browser/extensions/extension_install_prompt.h" |
| 13 | 13 |
| 14 class ExtensionInstallPromptShowParams; | |
| 15 @class ExtensionInstallViewController; | 14 @class ExtensionInstallViewController; |
| 16 @class WindowedInstallController; | 15 @class WindowedInstallController; |
| 17 | 16 |
| 18 // Displays an app or extension install or permissions prompt as a standalone | 17 // Displays an app or extension install or permissions prompt as a standalone |
| 19 // NSPanel. | 18 // NSPanel. |
| 20 class WindowedInstallDialogController | 19 class WindowedInstallDialogController |
| 21 : public ExtensionInstallPrompt::Delegate { | 20 : public ExtensionInstallPrompt::Delegate { |
| 22 public: | 21 public: |
| 23 // Initializes the ExtensionInstallViewController and shows the window. This | 22 // Initializes the ExtensionInstallViewController and shows the window. This |
| 24 // object will delete itself when the window is closed. | 23 // object will delete itself when the window is closed. |
| 25 WindowedInstallDialogController( | 24 WindowedInstallDialogController( |
| 26 ExtensionInstallPromptShowParams* show_params, | 25 const ExtensionInstallPrompt::ShowParams& show_params, |
| 27 ExtensionInstallPrompt::Delegate* delegate, | 26 ExtensionInstallPrompt::Delegate* delegate, |
| 28 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt); | 27 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt); |
| 29 ~WindowedInstallDialogController() override; | 28 ~WindowedInstallDialogController() override; |
| 30 | 29 |
| 31 // Invoked by the -[NSWindow windowWillClose:] notification after a dialog | 30 // Invoked by the -[NSWindow windowWillClose:] notification after a dialog |
| 32 // choice is invoked. Releases owned resources, then deletes |this|. | 31 // choice is invoked. Releases owned resources, then deletes |this|. |
| 33 void OnWindowClosing(); | 32 void OnWindowClosing(); |
| 34 | 33 |
| 35 // ExtensionInstallPrompt::Delegate: | 34 // ExtensionInstallPrompt::Delegate: |
| 36 void InstallUIProceed() override; | 35 void InstallUIProceed() override; |
| 37 void InstallUIAbort(bool user_initiated) override; | 36 void InstallUIAbort(bool user_initiated) override; |
| 38 | 37 |
| 39 private: | 38 private: |
| 40 FRIEND_TEST_ALL_PREFIXES(WindowedInstallDialogControllerBrowserTest, | 39 FRIEND_TEST_ALL_PREFIXES(WindowedInstallDialogControllerBrowserTest, |
| 41 ShowInstallDialog); | 40 ShowInstallDialog); |
| 42 ExtensionInstallViewController* GetViewController(); | 41 ExtensionInstallViewController* GetViewController(); |
| 43 | 42 |
| 44 ExtensionInstallPrompt::Delegate* delegate_; | 43 ExtensionInstallPrompt::Delegate* delegate_; |
| 45 base::scoped_nsobject<WindowedInstallController> install_controller_; | 44 base::scoped_nsobject<WindowedInstallController> install_controller_; |
| 46 | 45 |
| 47 DISALLOW_COPY_AND_ASSIGN(WindowedInstallDialogController); | 46 DISALLOW_COPY_AND_ASSIGN(WindowedInstallDialogController); |
| 48 }; | 47 }; |
| 49 | 48 |
| 50 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_WINDOWED_INSTALL_DIALOG_CONTROLLER
_H_ | 49 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_WINDOWED_INSTALL_DIALOG_CONTROLLER
_H_ |
| OLD | NEW |