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_API_WEBSTORE_PRIVATE_WEBSTORE_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEBSTORE_PRIVATE_WEBSTORE_PRIVATE_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_WEBSTORE_PRIVATE_WEBSTORE_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_WEBSTORE_PRIVATE_WEBSTORE_PRIVATE_API_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/extensions/bundle_installer.h" | 10 #include "chrome/browser/extensions/bundle_installer.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 // BundleInstaller::Delegate: | 57 // BundleInstaller::Delegate: |
58 virtual void OnBundleInstallApproved() OVERRIDE; | 58 virtual void OnBundleInstallApproved() OVERRIDE; |
59 virtual void OnBundleInstallCanceled(bool user_initiated) OVERRIDE; | 59 virtual void OnBundleInstallCanceled(bool user_initiated) OVERRIDE; |
60 virtual void OnBundleInstallCompleted() OVERRIDE; | 60 virtual void OnBundleInstallCompleted() OVERRIDE; |
61 | 61 |
62 protected: | 62 protected: |
63 virtual ~WebstorePrivateInstallBundleFunction(); | 63 virtual ~WebstorePrivateInstallBundleFunction(); |
64 | 64 |
65 // ExtensionFunction: | 65 // ExtensionFunction: |
66 virtual bool RunImpl() OVERRIDE; | 66 virtual bool RunAsync() OVERRIDE; |
67 | 67 |
68 // Reads the extension |details| into |items|. | 68 // Reads the extension |details| into |items|. |
69 bool ReadBundleInfo( | 69 bool ReadBundleInfo( |
70 const api::webstore_private::InstallBundle::Params& details, | 70 const api::webstore_private::InstallBundle::Params& details, |
71 extensions::BundleInstaller::ItemList* items); | 71 extensions::BundleInstaller::ItemList* items); |
72 | 72 |
73 private: | 73 private: |
74 scoped_refptr<extensions::BundleInstaller> bundle_; | 74 scoped_refptr<extensions::BundleInstaller> bundle_; |
75 }; | 75 }; |
76 | 76 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 const std::string& error_message) OVERRIDE; | 130 const std::string& error_message) OVERRIDE; |
131 | 131 |
132 // ExtensionInstallPrompt::Delegate: | 132 // ExtensionInstallPrompt::Delegate: |
133 virtual void InstallUIProceed() OVERRIDE; | 133 virtual void InstallUIProceed() OVERRIDE; |
134 virtual void InstallUIAbort(bool user_initiated) OVERRIDE; | 134 virtual void InstallUIAbort(bool user_initiated) OVERRIDE; |
135 | 135 |
136 protected: | 136 protected: |
137 virtual ~WebstorePrivateBeginInstallWithManifest3Function(); | 137 virtual ~WebstorePrivateBeginInstallWithManifest3Function(); |
138 | 138 |
139 // ExtensionFunction: | 139 // ExtensionFunction: |
140 virtual bool RunImpl() OVERRIDE; | 140 virtual bool RunAsync() OVERRIDE; |
141 | 141 |
142 // Sets the result_ as a string based on |code|. | 142 // Sets the result_ as a string based on |code|. |
143 void SetResultCode(ResultCode code); | 143 void SetResultCode(ResultCode code); |
144 | 144 |
145 private: | 145 private: |
146 // SigninTracker::Observer override. | 146 // SigninTracker::Observer override. |
147 virtual void SigninFailed(const GoogleServiceAuthError& error) OVERRIDE; | 147 virtual void SigninFailed(const GoogleServiceAuthError& error) OVERRIDE; |
148 virtual void SigninSuccess() OVERRIDE; | 148 virtual void SigninSuccess() OVERRIDE; |
149 virtual void MergeSessionComplete( | 149 virtual void MergeSessionComplete( |
150 const GoogleServiceAuthError& error) OVERRIDE; | 150 const GoogleServiceAuthError& error) OVERRIDE; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE; | 184 virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE; |
185 virtual void OnExtensionInstallFailure( | 185 virtual void OnExtensionInstallFailure( |
186 const std::string& id, | 186 const std::string& id, |
187 const std::string& error, | 187 const std::string& error, |
188 WebstoreInstaller::FailureReason reason) OVERRIDE; | 188 WebstoreInstaller::FailureReason reason) OVERRIDE; |
189 | 189 |
190 protected: | 190 protected: |
191 virtual ~WebstorePrivateCompleteInstallFunction(); | 191 virtual ~WebstorePrivateCompleteInstallFunction(); |
192 | 192 |
193 // ExtensionFunction: | 193 // ExtensionFunction: |
194 virtual bool RunImpl() OVERRIDE; | 194 virtual bool RunAsync() OVERRIDE; |
195 | 195 |
196 private: | 196 private: |
197 scoped_ptr<WebstoreInstaller::Approval> approval_; | 197 scoped_ptr<WebstoreInstaller::Approval> approval_; |
198 }; | 198 }; |
199 | 199 |
200 class WebstorePrivateEnableAppLauncherFunction | 200 class WebstorePrivateEnableAppLauncherFunction |
201 : public ChromeSyncExtensionFunction { | 201 : public ChromeSyncExtensionFunction { |
202 public: | 202 public: |
203 DECLARE_EXTENSION_FUNCTION("webstorePrivate.enableAppLauncher", | 203 DECLARE_EXTENSION_FUNCTION("webstorePrivate.enableAppLauncher", |
204 WEBSTOREPRIVATE_ENABLEAPPLAUNCHER) | 204 WEBSTOREPRIVATE_ENABLEAPPLAUNCHER) |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 WEBSTOREPRIVATE_GETWEBGLSTATUS) | 258 WEBSTOREPRIVATE_GETWEBGLSTATUS) |
259 | 259 |
260 WebstorePrivateGetWebGLStatusFunction(); | 260 WebstorePrivateGetWebGLStatusFunction(); |
261 | 261 |
262 protected: | 262 protected: |
263 virtual ~WebstorePrivateGetWebGLStatusFunction(); | 263 virtual ~WebstorePrivateGetWebGLStatusFunction(); |
264 | 264 |
265 void OnFeatureCheck(bool feature_allowed); | 265 void OnFeatureCheck(bool feature_allowed); |
266 | 266 |
267 // ExtensionFunction: | 267 // ExtensionFunction: |
268 virtual bool RunImpl() OVERRIDE; | 268 virtual bool RunAsync() OVERRIDE; |
269 | 269 |
270 private: | 270 private: |
271 void CreateResult(bool webgl_allowed); | 271 void CreateResult(bool webgl_allowed); |
272 | 272 |
273 scoped_refptr<GPUFeatureChecker> feature_checker_; | 273 scoped_refptr<GPUFeatureChecker> feature_checker_; |
274 }; | 274 }; |
275 | 275 |
276 class WebstorePrivateGetIsLauncherEnabledFunction | 276 class WebstorePrivateGetIsLauncherEnabledFunction |
277 : public ChromeSyncExtensionFunction { | 277 : public ChromeSyncExtensionFunction { |
278 public: | 278 public: |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 public: | 312 public: |
313 DECLARE_EXTENSION_FUNCTION("webstorePrivate.signIn", | 313 DECLARE_EXTENSION_FUNCTION("webstorePrivate.signIn", |
314 WEBSTOREPRIVATE_SIGNINFUNCTION) | 314 WEBSTOREPRIVATE_SIGNINFUNCTION) |
315 | 315 |
316 WebstorePrivateSignInFunction(); | 316 WebstorePrivateSignInFunction(); |
317 | 317 |
318 protected: | 318 protected: |
319 virtual ~WebstorePrivateSignInFunction(); | 319 virtual ~WebstorePrivateSignInFunction(); |
320 | 320 |
321 // ExtensionFunction: | 321 // ExtensionFunction: |
322 virtual bool RunImpl() OVERRIDE; | 322 virtual bool RunAsync() OVERRIDE; |
323 | 323 |
324 // SigninManagerFactory::Observer: | 324 // SigninManagerFactory::Observer: |
325 virtual void SigninManagerShutdown(SigninManagerBase* manager) OVERRIDE; | 325 virtual void SigninManagerShutdown(SigninManagerBase* manager) OVERRIDE; |
326 | 326 |
327 // SigninTracker::Observer: | 327 // SigninTracker::Observer: |
328 virtual void SigninFailed(const GoogleServiceAuthError& error) OVERRIDE; | 328 virtual void SigninFailed(const GoogleServiceAuthError& error) OVERRIDE; |
329 virtual void SigninSuccess() OVERRIDE; | 329 virtual void SigninSuccess() OVERRIDE; |
330 virtual void MergeSessionComplete(const GoogleServiceAuthError& error) | 330 virtual void MergeSessionComplete(const GoogleServiceAuthError& error) |
331 OVERRIDE; | 331 OVERRIDE; |
332 | 332 |
333 private: | 333 private: |
334 // The sign-in manager for the invoking tab's Chrome Profile. Weak reference. | 334 // The sign-in manager for the invoking tab's Chrome Profile. Weak reference. |
335 SigninManagerBase* signin_manager_; | 335 SigninManagerBase* signin_manager_; |
336 | 336 |
337 // Tracks changes to sign-in state. Used to notify the page when an existing | 337 // Tracks changes to sign-in state. Used to notify the page when an existing |
338 // in-progress sign-in completes, either with success or failure. | 338 // in-progress sign-in completes, either with success or failure. |
339 scoped_ptr<SigninTracker> signin_tracker_; | 339 scoped_ptr<SigninTracker> signin_tracker_; |
340 }; | 340 }; |
341 | 341 |
342 } // namespace extensions | 342 } // namespace extensions |
343 | 343 |
344 #endif // CHROME_BROWSER_EXTENSIONS_API_WEBSTORE_PRIVATE_WEBSTORE_PRIVATE_API_H
_ | 344 #endif // CHROME_BROWSER_EXTENSIONS_API_WEBSTORE_PRIVATE_WEBSTORE_PRIVATE_API_H
_ |
OLD | NEW |