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

Unified Diff: chrome/browser/extensions/api/webstore_private/webstore_private_api.h

Issue 850283003: Add a new webstorePrivate API to show a permission prompt for delegated installs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@testext_permission_prompt
Patch Set: rebase Created 5 years, 10 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/api/webstore_private/webstore_private_api.h
diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api.h b/chrome/browser/extensions/api/webstore_private/webstore_private_api.h
index 06436443a5092b233d0f766999e23e55e9ab4a6d..45f61134080cf8cb003cc810d82692b96f1e6331 100644
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.h
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.h
@@ -120,6 +120,55 @@ class WebstorePrivateCompleteInstallFunction
scoped_ptr<ScopedActiveInstall> scoped_active_install_;
};
+class WebstorePrivateShowPermissionPromptForDelegatedInstallFunction
+ : public UIThreadExtensionFunction,
+ public ExtensionInstallPrompt::Delegate,
+ public WebstoreInstallHelper::Delegate {
+ public:
+ DECLARE_EXTENSION_FUNCTION(
+ "webstorePrivate.showPermissionPromptForDelegatedInstall",
+ WEBSTOREPRIVATE_SHOWPERMISSIONPROMPTFORDELEGATEDINSTALL)
+
+ WebstorePrivateShowPermissionPromptForDelegatedInstallFunction();
+
+ private:
+ ~WebstorePrivateShowPermissionPromptForDelegatedInstallFunction() override;
+
+ // ExtensionFunction:
+ ExtensionFunction::ResponseAction Run() override;
+
+ // WebstoreInstallHelper::Delegate:
+ void OnWebstoreParseSuccess(const std::string& id,
+ const SkBitmap& icon,
+ base::DictionaryValue* parsed_manifest) override;
+ void OnWebstoreParseFailure(const std::string& id,
+ InstallHelperResultCode result,
+ const std::string& error_message) override;
+
+ // ExtensionInstallPrompt::Delegate:
+ void InstallUIProceed() override;
+ void InstallUIAbort(bool user_initiated) override;
+
+ ExtensionFunction::ResponseValue BuildResponse(
+ api::webstore_private::Result result,
+ const std::string& error);
+
+ // This stores the input parameters to the function.
+ scoped_ptr<api::webstore_private::ShowPermissionPromptForDelegatedInstall::
+ Params> params_;
+
+ // The results of parsing manifest_ and icon_data_ go into these two.
+ scoped_ptr<base::DictionaryValue> parsed_manifest_;
+ SkBitmap icon_;
+
+ // A dummy Extension object we create for the purposes of using
+ // ExtensionInstallPrompt to prompt for confirmation of the install.
+ scoped_refptr<Extension> dummy_extension_;
+
+ // The class that displays the install prompt.
+ scoped_ptr<ExtensionInstallPrompt> install_prompt_;
+};
+
class WebstorePrivateEnableAppLauncherFunction
: public UIThreadExtensionFunction {
public:

Powered by Google App Engine
This is Rietveld 408576698