OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_EXTENSIONS_EXTENSION_INSTALL_UI_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "chrome/browser/extensions/crx_installer_error.h" |
13 | 14 |
14 class Browser; | 15 class Browser; |
15 class SkBitmap; | 16 class SkBitmap; |
16 | 17 |
17 namespace extensions { | 18 namespace extensions { |
18 class Extension; | 19 class Extension; |
19 class ExtensionWebstorePrivateApiTest; | 20 class ExtensionWebstorePrivateApiTest; |
20 } // namespace extensions | 21 } // namespace extensions |
21 | 22 |
22 // Interface that should be implemented for each platform to display all the UI | 23 // Interface that should be implemented for each platform to display all the UI |
23 // around extension installation. | 24 // around extension installation. |
24 class ExtensionInstallUI { | 25 class ExtensionInstallUI { |
25 public: | 26 public: |
26 static ExtensionInstallUI* Create(Browser* browser); | 27 static ExtensionInstallUI* Create(Browser* browser); |
27 | 28 |
28 virtual ~ExtensionInstallUI(); | 29 virtual ~ExtensionInstallUI(); |
29 | 30 |
30 // Called when an extension was installed. | 31 // Called when an extension was installed. |
31 virtual void OnInstallSuccess(const extensions::Extension* extension, | 32 virtual void OnInstallSuccess(const extensions::Extension* extension, |
32 SkBitmap* icon) = 0; | 33 SkBitmap* icon) = 0; |
33 // Called when an extension failed to install. | 34 // Called when an extension failed to install. |
34 virtual void OnInstallFailure(const string16& error) = 0; | 35 virtual void OnInstallFailure(const CrxInstallerError& error) = 0; |
35 | 36 |
36 // Whether or not to show the default UI after completing the installation. | 37 // Whether or not to show the default UI after completing the installation. |
37 virtual void SetSkipPostInstallUI(bool skip_ui) = 0; | 38 virtual void SetSkipPostInstallUI(bool skip_ui) = 0; |
38 | 39 |
39 // TODO(asargent) Normally we navigate to the new tab page when an app is | 40 // TODO(asargent) Normally we navigate to the new tab page when an app is |
40 // installed, but we're experimenting with instead showing a bubble when | 41 // installed, but we're experimenting with instead showing a bubble when |
41 // an app is installed which points to the new tab button. This may become | 42 // an app is installed which points to the new tab button. This may become |
42 // the default behavior in the future. | 43 // the default behavior in the future. |
43 virtual void SetUseAppInstalledBubble(bool use_bubble) = 0; | 44 virtual void SetUseAppInstalledBubble(bool use_bubble) = 0; |
44 | 45 |
45 // Opens apps UI and animates the app icon for the app with id |app_id|. | 46 // Opens apps UI and animates the app icon for the app with id |app_id|. |
46 static void OpenAppInstalledUI(Browser* browser, const std::string& app_id); | 47 static void OpenAppInstalledUI(Browser* browser, const std::string& app_id); |
47 | 48 |
48 // Disables showing UI (ErrorBox, etc.) for install failures. To be used only | 49 // Disables showing UI (ErrorBox, etc.) for install failures. To be used only |
49 // in tests. | 50 // in tests. |
50 static void DisableFailureUIForTests(); | 51 static void DisableFailureUIForTests(); |
51 | 52 |
52 protected: | 53 protected: |
53 ExtensionInstallUI(); | 54 ExtensionInstallUI(); |
54 }; | 55 }; |
55 | 56 |
56 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_H_ | 57 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_H_ |
OLD | NEW |