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_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 |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 class WebstorePrivateApi { | 27 class WebstorePrivateApi { |
28 public: | 28 public: |
29 // Allows you to set the ProfileSyncService the function will use for | 29 // Allows you to set the ProfileSyncService the function will use for |
30 // testing purposes. | 30 // testing purposes. |
31 static void SetTestingProfileSyncService(ProfileSyncService* service); | 31 static void SetTestingProfileSyncService(ProfileSyncService* service); |
32 | 32 |
33 // Allows you to override the WebstoreInstaller delegate for testing. | 33 // Allows you to override the WebstoreInstaller delegate for testing. |
34 static void SetWebstoreInstallerDelegateForTesting( | 34 static void SetWebstoreInstallerDelegateForTesting( |
35 WebstoreInstaller::Delegate* delegate); | 35 WebstoreInstaller::Delegate* delegate); |
36 | |
37 // If |allow| is true, then the extension IDs used by the SilentlyInstall | |
38 // apitest will be trusted. | |
39 static void SetTrustTestIDsForTesting(bool allow); | |
40 }; | 36 }; |
41 | 37 |
42 class InstallBundleFunction : public AsyncExtensionFunction, | 38 class InstallBundleFunction : public AsyncExtensionFunction, |
43 public extensions::BundleInstaller::Delegate { | 39 public extensions::BundleInstaller::Delegate { |
44 public: | 40 public: |
45 InstallBundleFunction(); | 41 InstallBundleFunction(); |
46 | 42 |
47 // BundleInstaller::Delegate implementation. | 43 // BundleInstaller::Delegate implementation. |
48 virtual void OnBundleInstallApproved() OVERRIDE; | 44 virtual void OnBundleInstallApproved() OVERRIDE; |
49 virtual void OnBundleInstallCanceled(bool user_initiated) OVERRIDE; | 45 virtual void OnBundleInstallCanceled(bool user_initiated) OVERRIDE; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 scoped_refptr<Extension> dummy_extension_; | 131 scoped_refptr<Extension> dummy_extension_; |
136 | 132 |
137 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.beginInstallWithManifest3"); | 133 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.beginInstallWithManifest3"); |
138 }; | 134 }; |
139 | 135 |
140 class CompleteInstallFunction : public SyncExtensionFunction { | 136 class CompleteInstallFunction : public SyncExtensionFunction { |
141 virtual bool RunImpl() OVERRIDE; | 137 virtual bool RunImpl() OVERRIDE; |
142 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.completeInstall"); | 138 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.completeInstall"); |
143 }; | 139 }; |
144 | 140 |
145 class SilentlyInstallFunction : public AsyncExtensionFunction, | |
146 public WebstoreInstallHelper::Delegate, | |
147 public WebstoreInstaller::Delegate { | |
148 public: | |
149 SilentlyInstallFunction(); | |
150 | |
151 // WebstoreInstallHelper::Delegate implementation. | |
152 virtual void OnWebstoreParseSuccess( | |
153 const std::string& id, | |
154 const SkBitmap& icon, | |
155 base::DictionaryValue* parsed_manifest) OVERRIDE; | |
156 virtual void OnWebstoreParseFailure( | |
157 const std::string& id, | |
158 InstallHelperResultCode result_code, | |
159 const std::string& error_message) OVERRIDE; | |
160 | |
161 // WebstoreInstaller::Delegate implementation. | |
162 virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE; | |
163 virtual void OnExtensionInstallFailure(const std::string& id, | |
164 const std::string& error) OVERRIDE; | |
165 | |
166 protected: | |
167 virtual ~SilentlyInstallFunction(); | |
168 virtual bool RunImpl() OVERRIDE; | |
169 | |
170 private: | |
171 std::string id_; | |
172 std::string manifest_; | |
173 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.silentlyInstall"); | |
174 }; | |
175 | |
176 class GetBrowserLoginFunction : public SyncExtensionFunction { | 141 class GetBrowserLoginFunction : public SyncExtensionFunction { |
177 virtual bool RunImpl() OVERRIDE; | 142 virtual bool RunImpl() OVERRIDE; |
178 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.getBrowserLogin"); | 143 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.getBrowserLogin"); |
179 }; | 144 }; |
180 | 145 |
181 class GetStoreLoginFunction : public SyncExtensionFunction { | 146 class GetStoreLoginFunction : public SyncExtensionFunction { |
182 virtual bool RunImpl() OVERRIDE; | 147 virtual bool RunImpl() OVERRIDE; |
183 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.getStoreLogin"); | 148 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.getStoreLogin"); |
184 }; | 149 }; |
185 | 150 |
(...skipping 18 matching lines...) Expand all Loading... |
204 void CreateResult(bool webgl_allowed); | 169 void CreateResult(bool webgl_allowed); |
205 | 170 |
206 // A false return value is always valid, but a true one is only valid if full | 171 // A false return value is always valid, but a true one is only valid if full |
207 // GPU info has been collected in a GPU process. | 172 // GPU info has been collected in a GPU process. |
208 static bool IsWebGLAllowed(content::GpuDataManager* manager); | 173 static bool IsWebGLAllowed(content::GpuDataManager* manager); |
209 | 174 |
210 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.getWebGLStatus"); | 175 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.getWebGLStatus"); |
211 }; | 176 }; |
212 | 177 |
213 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ | 178 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ |
OLD | NEW |