OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_WEBSTORE_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
| 11 #include "chrome/browser/extensions/bundle_installer.h" |
11 #include "chrome/browser/extensions/extension_function.h" | 12 #include "chrome/browser/extensions/extension_function.h" |
12 #include "chrome/browser/extensions/extension_install_ui.h" | 13 #include "chrome/browser/extensions/extension_install_ui.h" |
13 #include "chrome/browser/extensions/webstore_install_helper.h" | 14 #include "chrome/browser/extensions/webstore_install_helper.h" |
14 #include "chrome/browser/extensions/webstore_installer.h" | 15 #include "chrome/browser/extensions/webstore_installer.h" |
15 #include "chrome/common/net/gaia/google_service_auth_error.h" | 16 #include "chrome/common/net/gaia/google_service_auth_error.h" |
16 #include "content/public/browser/gpu_data_manager_observer.h" | 17 #include "content/public/browser/gpu_data_manager_observer.h" |
17 #include "content/public/browser/notification_observer.h" | 18 #include "content/public/browser/notification_observer.h" |
18 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
19 | 20 |
20 class ProfileSyncService; | 21 class ProfileSyncService; |
(...skipping 10 matching lines...) Expand all Loading... |
31 | 32 |
32 // Allows you to override the WebstoreInstaller delegate for testing. | 33 // Allows you to override the WebstoreInstaller delegate for testing. |
33 static void SetWebstoreInstallerDelegateForTesting( | 34 static void SetWebstoreInstallerDelegateForTesting( |
34 WebstoreInstaller::Delegate* delegate); | 35 WebstoreInstaller::Delegate* delegate); |
35 | 36 |
36 // If |allow| is true, then the extension IDs used by the SilentlyInstall | 37 // If |allow| is true, then the extension IDs used by the SilentlyInstall |
37 // apitest will be trusted. | 38 // apitest will be trusted. |
38 static void SetTrustTestIDsForTesting(bool allow); | 39 static void SetTrustTestIDsForTesting(bool allow); |
39 }; | 40 }; |
40 | 41 |
| 42 class InstallBundleFunction : public AsyncExtensionFunction, |
| 43 public extensions::BundleInstaller::Delegate { |
| 44 public: |
| 45 InstallBundleFunction(); |
| 46 |
| 47 // BundleInstaller::Delegate implementation. |
| 48 virtual void OnBundleInstallApproved() OVERRIDE; |
| 49 virtual void OnBundleInstallCanceled(bool user_initiated) OVERRIDE; |
| 50 virtual void OnBundleInstallCompleted() OVERRIDE; |
| 51 |
| 52 protected: |
| 53 virtual ~InstallBundleFunction(); |
| 54 virtual bool RunImpl() OVERRIDE; |
| 55 |
| 56 // Reads the extension |details| into |items|. |
| 57 bool ReadBundleInfo(base::ListValue* details, |
| 58 extensions::BundleInstaller::ItemList* items); |
| 59 |
| 60 private: |
| 61 scoped_refptr<extensions::BundleInstaller> bundle_; |
| 62 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.installBundle"); |
| 63 }; |
| 64 |
41 class BeginInstallWithManifestFunction | 65 class BeginInstallWithManifestFunction |
42 : public AsyncExtensionFunction, | 66 : public AsyncExtensionFunction, |
43 public ExtensionInstallUI::Delegate, | 67 public ExtensionInstallUI::Delegate, |
44 public WebstoreInstallHelper::Delegate { | 68 public WebstoreInstallHelper::Delegate { |
45 public: | 69 public: |
46 BeginInstallWithManifestFunction(); | 70 BeginInstallWithManifestFunction(); |
47 | 71 |
48 // Result codes for the return value. If you change this, make sure to | 72 // Result codes for the return value. If you change this, make sure to |
49 // update the description for the beginInstallWithManifest3 callback in | 73 // update the description for the beginInstallWithManifest3 callback in |
50 // the extension API JSON. | 74 // the extension API JSON. |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 void CreateResult(bool webgl_allowed); | 204 void CreateResult(bool webgl_allowed); |
181 | 205 |
182 // A false return value is always valid, but a true one is only valid if full | 206 // A false return value is always valid, but a true one is only valid if full |
183 // GPU info has been collected in a GPU process. | 207 // GPU info has been collected in a GPU process. |
184 static bool IsWebGLAllowed(content::GpuDataManager* manager); | 208 static bool IsWebGLAllowed(content::GpuDataManager* manager); |
185 | 209 |
186 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.getWebGLStatus"); | 210 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.getWebGLStatus"); |
187 }; | 211 }; |
188 | 212 |
189 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ | 213 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ |
OLD | NEW |