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

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

Issue 8391004: Add webstorePrivate API for installing bundles of extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 2 months 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..411441cec2e445e4bc01371057518c3860c4b900 100644
--- a/chrome/browser/extensions/extension_webstore_private_api.h
+++ b/chrome/browser/extensions/extension_webstore_private_api.h
@@ -10,6 +10,7 @@
#include "chrome/browser/extensions/extension_function.h"
#include "chrome/browser/extensions/extension_install_ui.h"
+#include "chrome/browser/extensions/webstore_bundle.h"
#include "chrome/browser/extensions/webstore_install_helper.h"
#include "chrome/browser/extensions/webstore_installer.h"
#include "chrome/common/net/gaia/google_service_auth_error.h"
@@ -29,6 +30,47 @@ class WebstorePrivateApi {
WebstoreInstaller::Delegate* delegate);
};
+class InstallBundleFunction : public AsyncExtensionFunction,
+ public WebstoreBundle::Delegate {
+ public:
+ InstallBundleFunction();
+
+ // Result codes for the return value. If you change this, make sure to
+ // update the description for the beginInstallBundle callback in
+ // extension_api.json.
+ enum ErrorCode {
+ ERROR_NONE = 0,
+
+ // An unspecified error occurred.
+ UNKNOWN_ERROR,
+
+ // The user cancelled the confirmation dialog instead of accepting it.
+ USER_CANCELLED,
+
+ // The page does not have permission to call this function.
+ PERMISSION_DENIED,
+ };
+
+ virtual void OnBundleInstallApproved() OVERRIDE;
+ virtual void OnBundleInstallCanceled(bool user_initiated) OVERRIDE;
+ virtual void OnBundleInstallCompleted() OVERRIDE;
+
+ protected:
+ virtual ~InstallBundleFunction();
+ virtual bool RunImpl() OVERRIDE;
+
+ // Reads the extension details from |extensions| into |items|.
+ bool ReadBundleInfo(base::ListValue* extensions,
+ WebstoreBundle::ItemList* items);
+
+ // Sets the result_ as a string based on |code|.
+ void SetResult(ErrorCode code);
+
+ private:
+ scoped_refptr<WebstoreBundle> bundle_;
+ DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.installBundle");
+};
+
class BeginInstallWithManifestFunction
: public AsyncExtensionFunction,
public ExtensionInstallUI::Delegate,
« 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