| 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/active_install_data.h" | 10 #include "chrome/browser/extensions/active_install_data.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 class WebstorePrivateInstallBundleFunction | 47 class WebstorePrivateInstallBundleFunction |
| 48 : public ChromeAsyncExtensionFunction, | 48 : public ChromeAsyncExtensionFunction, |
| 49 public extensions::BundleInstaller::Delegate { | 49 public extensions::BundleInstaller::Delegate { |
| 50 public: | 50 public: |
| 51 DECLARE_EXTENSION_FUNCTION("webstorePrivate.installBundle", | 51 DECLARE_EXTENSION_FUNCTION("webstorePrivate.installBundle", |
| 52 WEBSTOREPRIVATE_INSTALLBUNDLE) | 52 WEBSTOREPRIVATE_INSTALLBUNDLE) |
| 53 | 53 |
| 54 WebstorePrivateInstallBundleFunction(); | 54 WebstorePrivateInstallBundleFunction(); |
| 55 | 55 |
| 56 // BundleInstaller::Delegate: | 56 // BundleInstaller::Delegate: |
| 57 virtual void OnBundleInstallApproved() OVERRIDE; | 57 virtual void OnBundleInstallApproved() override; |
| 58 virtual void OnBundleInstallCanceled(bool user_initiated) OVERRIDE; | 58 virtual void OnBundleInstallCanceled(bool user_initiated) override; |
| 59 virtual void OnBundleInstallCompleted() OVERRIDE; | 59 virtual void OnBundleInstallCompleted() override; |
| 60 | 60 |
| 61 protected: | 61 protected: |
| 62 virtual ~WebstorePrivateInstallBundleFunction(); | 62 virtual ~WebstorePrivateInstallBundleFunction(); |
| 63 | 63 |
| 64 // ExtensionFunction: | 64 // ExtensionFunction: |
| 65 virtual bool RunAsync() OVERRIDE; | 65 virtual bool RunAsync() override; |
| 66 | 66 |
| 67 // Reads the extension |details| into |items|. | 67 // Reads the extension |details| into |items|. |
| 68 bool ReadBundleInfo( | 68 bool ReadBundleInfo( |
| 69 const api::webstore_private::InstallBundle::Params& details, | 69 const api::webstore_private::InstallBundle::Params& details, |
| 70 extensions::BundleInstaller::ItemList* items); | 70 extensions::BundleInstaller::ItemList* items); |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 scoped_refptr<extensions::BundleInstaller> bundle_; | 73 scoped_refptr<extensions::BundleInstaller> bundle_; |
| 74 }; | 74 }; |
| 75 | 75 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // An extension with the same extension id has already been installed. | 111 // An extension with the same extension id has already been installed. |
| 112 ALREADY_INSTALLED, | 112 ALREADY_INSTALLED, |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 WebstorePrivateBeginInstallWithManifest3Function(); | 115 WebstorePrivateBeginInstallWithManifest3Function(); |
| 116 | 116 |
| 117 // WebstoreInstallHelper::Delegate: | 117 // WebstoreInstallHelper::Delegate: |
| 118 virtual void OnWebstoreParseSuccess( | 118 virtual void OnWebstoreParseSuccess( |
| 119 const std::string& id, | 119 const std::string& id, |
| 120 const SkBitmap& icon, | 120 const SkBitmap& icon, |
| 121 base::DictionaryValue* parsed_manifest) OVERRIDE; | 121 base::DictionaryValue* parsed_manifest) override; |
| 122 virtual void OnWebstoreParseFailure( | 122 virtual void OnWebstoreParseFailure( |
| 123 const std::string& id, | 123 const std::string& id, |
| 124 InstallHelperResultCode result_code, | 124 InstallHelperResultCode result_code, |
| 125 const std::string& error_message) OVERRIDE; | 125 const std::string& error_message) override; |
| 126 | 126 |
| 127 // ExtensionInstallPrompt::Delegate: | 127 // ExtensionInstallPrompt::Delegate: |
| 128 virtual void InstallUIProceed() OVERRIDE; | 128 virtual void InstallUIProceed() override; |
| 129 virtual void InstallUIAbort(bool user_initiated) OVERRIDE; | 129 virtual void InstallUIAbort(bool user_initiated) override; |
| 130 | 130 |
| 131 protected: | 131 protected: |
| 132 virtual ~WebstorePrivateBeginInstallWithManifest3Function(); | 132 virtual ~WebstorePrivateBeginInstallWithManifest3Function(); |
| 133 | 133 |
| 134 // ExtensionFunction: | 134 // ExtensionFunction: |
| 135 virtual bool RunAsync() OVERRIDE; | 135 virtual bool RunAsync() override; |
| 136 | 136 |
| 137 // Sets the result_ as a string based on |code|. | 137 // Sets the result_ as a string based on |code|. |
| 138 void SetResultCode(ResultCode code); | 138 void SetResultCode(ResultCode code); |
| 139 | 139 |
| 140 private: | 140 private: |
| 141 const char* ResultCodeToString(ResultCode code); | 141 const char* ResultCodeToString(ResultCode code); |
| 142 | 142 |
| 143 // These store the input parameters to the function. | 143 // These store the input parameters to the function. |
| 144 scoped_ptr<api::webstore_private::BeginInstallWithManifest3::Params> params_; | 144 scoped_ptr<api::webstore_private::BeginInstallWithManifest3::Params> params_; |
| 145 | 145 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 164 class WebstorePrivateCompleteInstallFunction | 164 class WebstorePrivateCompleteInstallFunction |
| 165 : public ChromeAsyncExtensionFunction, | 165 : public ChromeAsyncExtensionFunction, |
| 166 public WebstoreInstaller::Delegate { | 166 public WebstoreInstaller::Delegate { |
| 167 public: | 167 public: |
| 168 DECLARE_EXTENSION_FUNCTION("webstorePrivate.completeInstall", | 168 DECLARE_EXTENSION_FUNCTION("webstorePrivate.completeInstall", |
| 169 WEBSTOREPRIVATE_COMPLETEINSTALL) | 169 WEBSTOREPRIVATE_COMPLETEINSTALL) |
| 170 | 170 |
| 171 WebstorePrivateCompleteInstallFunction(); | 171 WebstorePrivateCompleteInstallFunction(); |
| 172 | 172 |
| 173 // WebstoreInstaller::Delegate: | 173 // WebstoreInstaller::Delegate: |
| 174 virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE; | 174 virtual void OnExtensionInstallSuccess(const std::string& id) override; |
| 175 virtual void OnExtensionInstallFailure( | 175 virtual void OnExtensionInstallFailure( |
| 176 const std::string& id, | 176 const std::string& id, |
| 177 const std::string& error, | 177 const std::string& error, |
| 178 WebstoreInstaller::FailureReason reason) OVERRIDE; | 178 WebstoreInstaller::FailureReason reason) override; |
| 179 | 179 |
| 180 protected: | 180 protected: |
| 181 virtual ~WebstorePrivateCompleteInstallFunction(); | 181 virtual ~WebstorePrivateCompleteInstallFunction(); |
| 182 | 182 |
| 183 // ExtensionFunction: | 183 // ExtensionFunction: |
| 184 virtual bool RunAsync() OVERRIDE; | 184 virtual bool RunAsync() override; |
| 185 | 185 |
| 186 private: | 186 private: |
| 187 scoped_ptr<WebstoreInstaller::Approval> approval_; | 187 scoped_ptr<WebstoreInstaller::Approval> approval_; |
| 188 scoped_ptr<ScopedActiveInstall> scoped_active_install_; | 188 scoped_ptr<ScopedActiveInstall> scoped_active_install_; |
| 189 | 189 |
| 190 void OnInstallSuccess(const std::string& id); | 190 void OnInstallSuccess(const std::string& id); |
| 191 }; | 191 }; |
| 192 | 192 |
| 193 class WebstorePrivateEnableAppLauncherFunction | 193 class WebstorePrivateEnableAppLauncherFunction |
| 194 : public ChromeSyncExtensionFunction { | 194 : public ChromeSyncExtensionFunction { |
| 195 public: | 195 public: |
| 196 DECLARE_EXTENSION_FUNCTION("webstorePrivate.enableAppLauncher", | 196 DECLARE_EXTENSION_FUNCTION("webstorePrivate.enableAppLauncher", |
| 197 WEBSTOREPRIVATE_ENABLEAPPLAUNCHER) | 197 WEBSTOREPRIVATE_ENABLEAPPLAUNCHER) |
| 198 | 198 |
| 199 WebstorePrivateEnableAppLauncherFunction(); | 199 WebstorePrivateEnableAppLauncherFunction(); |
| 200 | 200 |
| 201 protected: | 201 protected: |
| 202 virtual ~WebstorePrivateEnableAppLauncherFunction(); | 202 virtual ~WebstorePrivateEnableAppLauncherFunction(); |
| 203 | 203 |
| 204 // ExtensionFunction: | 204 // ExtensionFunction: |
| 205 virtual bool RunSync() OVERRIDE; | 205 virtual bool RunSync() override; |
| 206 }; | 206 }; |
| 207 | 207 |
| 208 class WebstorePrivateGetBrowserLoginFunction | 208 class WebstorePrivateGetBrowserLoginFunction |
| 209 : public ChromeSyncExtensionFunction { | 209 : public ChromeSyncExtensionFunction { |
| 210 public: | 210 public: |
| 211 DECLARE_EXTENSION_FUNCTION("webstorePrivate.getBrowserLogin", | 211 DECLARE_EXTENSION_FUNCTION("webstorePrivate.getBrowserLogin", |
| 212 WEBSTOREPRIVATE_GETBROWSERLOGIN) | 212 WEBSTOREPRIVATE_GETBROWSERLOGIN) |
| 213 | 213 |
| 214 protected: | 214 protected: |
| 215 virtual ~WebstorePrivateGetBrowserLoginFunction() {} | 215 virtual ~WebstorePrivateGetBrowserLoginFunction() {} |
| 216 | 216 |
| 217 // ExtensionFunction: | 217 // ExtensionFunction: |
| 218 virtual bool RunSync() OVERRIDE; | 218 virtual bool RunSync() override; |
| 219 }; | 219 }; |
| 220 | 220 |
| 221 class WebstorePrivateGetStoreLoginFunction | 221 class WebstorePrivateGetStoreLoginFunction |
| 222 : public ChromeSyncExtensionFunction { | 222 : public ChromeSyncExtensionFunction { |
| 223 public: | 223 public: |
| 224 DECLARE_EXTENSION_FUNCTION("webstorePrivate.getStoreLogin", | 224 DECLARE_EXTENSION_FUNCTION("webstorePrivate.getStoreLogin", |
| 225 WEBSTOREPRIVATE_GETSTORELOGIN) | 225 WEBSTOREPRIVATE_GETSTORELOGIN) |
| 226 | 226 |
| 227 protected: | 227 protected: |
| 228 virtual ~WebstorePrivateGetStoreLoginFunction() {} | 228 virtual ~WebstorePrivateGetStoreLoginFunction() {} |
| 229 | 229 |
| 230 // ExtensionFunction: | 230 // ExtensionFunction: |
| 231 virtual bool RunSync() OVERRIDE; | 231 virtual bool RunSync() override; |
| 232 }; | 232 }; |
| 233 | 233 |
| 234 class WebstorePrivateSetStoreLoginFunction | 234 class WebstorePrivateSetStoreLoginFunction |
| 235 : public ChromeSyncExtensionFunction { | 235 : public ChromeSyncExtensionFunction { |
| 236 public: | 236 public: |
| 237 DECLARE_EXTENSION_FUNCTION("webstorePrivate.setStoreLogin", | 237 DECLARE_EXTENSION_FUNCTION("webstorePrivate.setStoreLogin", |
| 238 WEBSTOREPRIVATE_SETSTORELOGIN) | 238 WEBSTOREPRIVATE_SETSTORELOGIN) |
| 239 | 239 |
| 240 protected: | 240 protected: |
| 241 virtual ~WebstorePrivateSetStoreLoginFunction() {} | 241 virtual ~WebstorePrivateSetStoreLoginFunction() {} |
| 242 | 242 |
| 243 // ExtensionFunction: | 243 // ExtensionFunction: |
| 244 virtual bool RunSync() OVERRIDE; | 244 virtual bool RunSync() override; |
| 245 }; | 245 }; |
| 246 | 246 |
| 247 class WebstorePrivateGetWebGLStatusFunction | 247 class WebstorePrivateGetWebGLStatusFunction |
| 248 : public ChromeAsyncExtensionFunction { | 248 : public ChromeAsyncExtensionFunction { |
| 249 public: | 249 public: |
| 250 DECLARE_EXTENSION_FUNCTION("webstorePrivate.getWebGLStatus", | 250 DECLARE_EXTENSION_FUNCTION("webstorePrivate.getWebGLStatus", |
| 251 WEBSTOREPRIVATE_GETWEBGLSTATUS) | 251 WEBSTOREPRIVATE_GETWEBGLSTATUS) |
| 252 | 252 |
| 253 WebstorePrivateGetWebGLStatusFunction(); | 253 WebstorePrivateGetWebGLStatusFunction(); |
| 254 | 254 |
| 255 protected: | 255 protected: |
| 256 virtual ~WebstorePrivateGetWebGLStatusFunction(); | 256 virtual ~WebstorePrivateGetWebGLStatusFunction(); |
| 257 | 257 |
| 258 void OnFeatureCheck(bool feature_allowed); | 258 void OnFeatureCheck(bool feature_allowed); |
| 259 | 259 |
| 260 // ExtensionFunction: | 260 // ExtensionFunction: |
| 261 virtual bool RunAsync() OVERRIDE; | 261 virtual bool RunAsync() override; |
| 262 | 262 |
| 263 private: | 263 private: |
| 264 void CreateResult(bool webgl_allowed); | 264 void CreateResult(bool webgl_allowed); |
| 265 | 265 |
| 266 scoped_refptr<GPUFeatureChecker> feature_checker_; | 266 scoped_refptr<GPUFeatureChecker> feature_checker_; |
| 267 }; | 267 }; |
| 268 | 268 |
| 269 class WebstorePrivateGetIsLauncherEnabledFunction | 269 class WebstorePrivateGetIsLauncherEnabledFunction |
| 270 : public ChromeSyncExtensionFunction { | 270 : public ChromeSyncExtensionFunction { |
| 271 public: | 271 public: |
| 272 DECLARE_EXTENSION_FUNCTION("webstorePrivate.getIsLauncherEnabled", | 272 DECLARE_EXTENSION_FUNCTION("webstorePrivate.getIsLauncherEnabled", |
| 273 WEBSTOREPRIVATE_GETISLAUNCHERENABLED) | 273 WEBSTOREPRIVATE_GETISLAUNCHERENABLED) |
| 274 | 274 |
| 275 WebstorePrivateGetIsLauncherEnabledFunction() {} | 275 WebstorePrivateGetIsLauncherEnabledFunction() {} |
| 276 | 276 |
| 277 protected: | 277 protected: |
| 278 virtual ~WebstorePrivateGetIsLauncherEnabledFunction() {} | 278 virtual ~WebstorePrivateGetIsLauncherEnabledFunction() {} |
| 279 | 279 |
| 280 // ExtensionFunction: | 280 // ExtensionFunction: |
| 281 virtual bool RunSync() OVERRIDE; | 281 virtual bool RunSync() override; |
| 282 | 282 |
| 283 private: | 283 private: |
| 284 void OnIsLauncherCheckCompleted(bool is_enabled); | 284 void OnIsLauncherCheckCompleted(bool is_enabled); |
| 285 }; | 285 }; |
| 286 | 286 |
| 287 class WebstorePrivateIsInIncognitoModeFunction | 287 class WebstorePrivateIsInIncognitoModeFunction |
| 288 : public ChromeSyncExtensionFunction { | 288 : public ChromeSyncExtensionFunction { |
| 289 public: | 289 public: |
| 290 DECLARE_EXTENSION_FUNCTION("webstorePrivate.isInIncognitoMode", | 290 DECLARE_EXTENSION_FUNCTION("webstorePrivate.isInIncognitoMode", |
| 291 WEBSTOREPRIVATE_ISININCOGNITOMODEFUNCTION) | 291 WEBSTOREPRIVATE_ISININCOGNITOMODEFUNCTION) |
| 292 | 292 |
| 293 WebstorePrivateIsInIncognitoModeFunction() {} | 293 WebstorePrivateIsInIncognitoModeFunction() {} |
| 294 | 294 |
| 295 protected: | 295 protected: |
| 296 virtual ~WebstorePrivateIsInIncognitoModeFunction() {} | 296 virtual ~WebstorePrivateIsInIncognitoModeFunction() {} |
| 297 | 297 |
| 298 // ExtensionFunction: | 298 // ExtensionFunction: |
| 299 virtual bool RunSync() OVERRIDE; | 299 virtual bool RunSync() override; |
| 300 }; | 300 }; |
| 301 | 301 |
| 302 class WebstorePrivateLaunchEphemeralAppFunction | 302 class WebstorePrivateLaunchEphemeralAppFunction |
| 303 : public ChromeAsyncExtensionFunction { | 303 : public ChromeAsyncExtensionFunction { |
| 304 public: | 304 public: |
| 305 DECLARE_EXTENSION_FUNCTION("webstorePrivate.launchEphemeralApp", | 305 DECLARE_EXTENSION_FUNCTION("webstorePrivate.launchEphemeralApp", |
| 306 WEBSTOREPRIVATE_LAUNCHEPHEMERALAPP) | 306 WEBSTOREPRIVATE_LAUNCHEPHEMERALAPP) |
| 307 | 307 |
| 308 WebstorePrivateLaunchEphemeralAppFunction(); | 308 WebstorePrivateLaunchEphemeralAppFunction(); |
| 309 | 309 |
| 310 protected: | 310 protected: |
| 311 virtual ~WebstorePrivateLaunchEphemeralAppFunction(); | 311 virtual ~WebstorePrivateLaunchEphemeralAppFunction(); |
| 312 | 312 |
| 313 // ExtensionFunction: | 313 // ExtensionFunction: |
| 314 virtual bool RunAsync() OVERRIDE; | 314 virtual bool RunAsync() override; |
| 315 | 315 |
| 316 private: | 316 private: |
| 317 void OnLaunchComplete(webstore_install::Result result, | 317 void OnLaunchComplete(webstore_install::Result result, |
| 318 const std::string& error); | 318 const std::string& error); |
| 319 void SetResult( | 319 void SetResult( |
| 320 api::webstore_private::LaunchEphemeralApp::Results::Result result, | 320 api::webstore_private::LaunchEphemeralApp::Results::Result result, |
| 321 const std::string& error); | 321 const std::string& error); |
| 322 }; | 322 }; |
| 323 | 323 |
| 324 class WebstorePrivateGetEphemeralAppsEnabledFunction | 324 class WebstorePrivateGetEphemeralAppsEnabledFunction |
| 325 : public ChromeSyncExtensionFunction { | 325 : public ChromeSyncExtensionFunction { |
| 326 public: | 326 public: |
| 327 DECLARE_EXTENSION_FUNCTION("webstorePrivate.getEphemeralAppsEnabled", | 327 DECLARE_EXTENSION_FUNCTION("webstorePrivate.getEphemeralAppsEnabled", |
| 328 WEBSTOREPRIVATE_GETEPHEMERALAPPSENABLED) | 328 WEBSTOREPRIVATE_GETEPHEMERALAPPSENABLED) |
| 329 | 329 |
| 330 WebstorePrivateGetEphemeralAppsEnabledFunction(); | 330 WebstorePrivateGetEphemeralAppsEnabledFunction(); |
| 331 | 331 |
| 332 protected: | 332 protected: |
| 333 virtual ~WebstorePrivateGetEphemeralAppsEnabledFunction(); | 333 virtual ~WebstorePrivateGetEphemeralAppsEnabledFunction(); |
| 334 | 334 |
| 335 // ExtensionFunction: | 335 // ExtensionFunction: |
| 336 virtual bool RunSync() OVERRIDE; | 336 virtual bool RunSync() override; |
| 337 }; | 337 }; |
| 338 | 338 |
| 339 } // namespace extensions | 339 } // namespace extensions |
| 340 | 340 |
| 341 #endif // CHROME_BROWSER_EXTENSIONS_API_WEBSTORE_PRIVATE_WEBSTORE_PRIVATE_API_H
_ | 341 #endif // CHROME_BROWSER_EXTENSIONS_API_WEBSTORE_PRIVATE_WEBSTORE_PRIVATE_API_H
_ |
| OLD | NEW |