Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6645)

Unified Diff: chrome/browser/extensions/extension_webstore_private_api.h

Issue 8430033: Adds a webstorePrivate method for silently installing extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mihai Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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");
« no previous file with comments | « chrome/browser/extensions/extension_install_ui.cc ('k') | chrome/browser/extensions/extension_webstore_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698