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

Side by Side 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 unified diff | Download patch
OLDNEW
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 WebstoreInstaller::FailureReason reason) override; 113 WebstoreInstaller::FailureReason reason) override;
114 114
115 void OnInstallSuccess(const std::string& id); 115 void OnInstallSuccess(const std::string& id);
116 116
117 ChromeExtensionFunctionDetails chrome_details_; 117 ChromeExtensionFunctionDetails chrome_details_;
118 118
119 scoped_ptr<WebstoreInstaller::Approval> approval_; 119 scoped_ptr<WebstoreInstaller::Approval> approval_;
120 scoped_ptr<ScopedActiveInstall> scoped_active_install_; 120 scoped_ptr<ScopedActiveInstall> scoped_active_install_;
121 }; 121 };
122 122
123 class WebstorePrivateShowPermissionPromptForDelegatedInstallFunction
124 : public UIThreadExtensionFunction,
125 public ExtensionInstallPrompt::Delegate,
126 public WebstoreInstallHelper::Delegate {
127 public:
128 DECLARE_EXTENSION_FUNCTION(
129 "webstorePrivate.showPermissionPromptForDelegatedInstall",
130 WEBSTOREPRIVATE_SHOWPERMISSIONPROMPTFORDELEGATEDINSTALL)
131
132 WebstorePrivateShowPermissionPromptForDelegatedInstallFunction();
133
134 private:
135 ~WebstorePrivateShowPermissionPromptForDelegatedInstallFunction() override;
136
137 // ExtensionFunction:
138 ExtensionFunction::ResponseAction Run() override;
139
140 // WebstoreInstallHelper::Delegate:
141 void OnWebstoreParseSuccess(const std::string& id,
142 const SkBitmap& icon,
143 base::DictionaryValue* parsed_manifest) override;
144 void OnWebstoreParseFailure(const std::string& id,
145 InstallHelperResultCode result,
146 const std::string& error_message) override;
147
148 // ExtensionInstallPrompt::Delegate:
149 void InstallUIProceed() override;
150 void InstallUIAbort(bool user_initiated) override;
151
152 ExtensionFunction::ResponseValue BuildResponse(
153 api::webstore_private::Result result,
154 const std::string& error);
155
156 // This stores the input parameters to the function.
157 scoped_ptr<api::webstore_private::ShowPermissionPromptForDelegatedInstall::
158 Params> params_;
159
160 // The results of parsing manifest_ and icon_data_ go into these two.
161 scoped_ptr<base::DictionaryValue> parsed_manifest_;
162 SkBitmap icon_;
163
164 // A dummy Extension object we create for the purposes of using
165 // ExtensionInstallPrompt to prompt for confirmation of the install.
166 scoped_refptr<Extension> dummy_extension_;
167
168 // The class that displays the install prompt.
169 scoped_ptr<ExtensionInstallPrompt> install_prompt_;
170 };
171
123 class WebstorePrivateEnableAppLauncherFunction 172 class WebstorePrivateEnableAppLauncherFunction
124 : public UIThreadExtensionFunction { 173 : public UIThreadExtensionFunction {
125 public: 174 public:
126 DECLARE_EXTENSION_FUNCTION("webstorePrivate.enableAppLauncher", 175 DECLARE_EXTENSION_FUNCTION("webstorePrivate.enableAppLauncher",
127 WEBSTOREPRIVATE_ENABLEAPPLAUNCHER) 176 WEBSTOREPRIVATE_ENABLEAPPLAUNCHER)
128 177
129 WebstorePrivateEnableAppLauncherFunction(); 178 WebstorePrivateEnableAppLauncherFunction();
130 179
131 private: 180 private:
132 ~WebstorePrivateEnableAppLauncherFunction() override; 181 ~WebstorePrivateEnableAppLauncherFunction() override;
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 private: 325 private:
277 ~WebstorePrivateGetEphemeralAppsEnabledFunction() override; 326 ~WebstorePrivateGetEphemeralAppsEnabledFunction() override;
278 327
279 // ExtensionFunction: 328 // ExtensionFunction:
280 ExtensionFunction::ResponseAction Run() override; 329 ExtensionFunction::ResponseAction Run() override;
281 }; 330 };
282 331
283 } // namespace extensions 332 } // namespace extensions
284 333
285 #endif // CHROME_BROWSER_EXTENSIONS_API_WEBSTORE_PRIVATE_WEBSTORE_PRIVATE_API_H _ 334 #endif // CHROME_BROWSER_EXTENSIONS_API_WEBSTORE_PRIVATE_WEBSTORE_PRIVATE_API_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698