Index: chrome/browser/extensions/extension_webstore_private_api.h |
diff --git a/chrome/browser/extensions/extension_webstore_private_api.h b/chrome/browser/extensions/extension_webstore_private_api.h |
index f1021e1955e74bb6f33b3b5b862f9fd80143f315..4dd9b8213165e2ca8a8a6a2b4291a7fe95592ead 100644 |
--- a/chrome/browser/extensions/extension_webstore_private_api.h |
+++ b/chrome/browser/extensions/extension_webstore_private_api.h |
@@ -27,6 +27,10 @@ class WebstorePrivateApi { |
// Allows you to override the WebstoreInstaller delegate for testing. |
static void SetWebstoreInstallerDelegateForTesting( |
WebstoreInstaller::Delegate* delegate); |
+ |
+ // If |allow| is true, then the extension IDs used by the SilentlyInstall |
+ // apitest will be trusted. |
+ static void SetTrustTestIDsForTesting(bool allow); |
}; |
class BeginInstallWithManifestFunction |
@@ -109,6 +113,37 @@ class CompleteInstallFunction : public SyncExtensionFunction { |
DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.completeInstall"); |
}; |
+class SilentlyInstallFunction : public AsyncExtensionFunction, |
+ public WebstoreInstallHelper::Delegate, |
+ public WebstoreInstaller::Delegate { |
+ public: |
+ SilentlyInstallFunction(); |
+ |
+ // WebstoreInstallHelper::Delegate implementation. |
+ virtual void OnWebstoreParseSuccess( |
+ const std::string& id, |
+ const SkBitmap& icon, |
+ base::DictionaryValue* parsed_manifest) OVERRIDE; |
+ virtual void OnWebstoreParseFailure( |
+ const std::string& id, |
+ InstallHelperResultCode result_code, |
+ const std::string& error_message) OVERRIDE; |
+ |
+ // WebstoreInstaller::Delegate implementation. |
+ virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE; |
+ virtual void OnExtensionInstallFailure(const std::string& id, |
+ const std::string& error) OVERRIDE; |
+ |
+ protected: |
+ virtual ~SilentlyInstallFunction(); |
+ virtual bool RunImpl() OVERRIDE; |
+ |
+ private: |
+ std::string id_; |
+ std::string manifest_; |
+ DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.silentlyInstall"); |
+}; |
+ |
class GetBrowserLoginFunction : public SyncExtensionFunction { |
virtual bool RunImpl(); |
DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.getBrowserLogin"); |