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

Side by Side Diff: chrome/browser/extensions/api/webstore_private/webstore_private_api.h

Issue 855513002: Add/resurrect support for bundles of WebStore items. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@testext_bundle
Patch Set: cleanup;rebase Created 5 years, 9 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"
11 #include "chrome/browser/extensions/bundle_installer.h"
11 #include "chrome/browser/extensions/chrome_extension_function_details.h" 12 #include "chrome/browser/extensions/chrome_extension_function_details.h"
12 #include "chrome/browser/extensions/extension_install_prompt.h" 13 #include "chrome/browser/extensions/extension_install_prompt.h"
13 #include "chrome/browser/extensions/webstore_install_helper.h" 14 #include "chrome/browser/extensions/webstore_install_helper.h"
14 #include "chrome/browser/extensions/webstore_installer.h" 15 #include "chrome/browser/extensions/webstore_installer.h"
15 #include "chrome/common/extensions/api/webstore_private.h" 16 #include "chrome/common/extensions/api/webstore_private.h"
16 #include "chrome/common/extensions/webstore_install_result.h" 17 #include "chrome/common/extensions/webstore_install_result.h"
17 #include "extensions/browser/extension_function.h" 18 #include "extensions/browser/extension_function.h"
18 #include "third_party/skia/include/core/SkBitmap.h" 19 #include "third_party/skia/include/core/SkBitmap.h"
19 20
20 class GPUFeatureChecker; 21 class GPUFeatureChecker;
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 WebstorePrivateShowPermissionPromptForDelegatedInstallFunction(); 176 WebstorePrivateShowPermissionPromptForDelegatedInstallFunction();
176 177
177 private: 178 private:
178 ~WebstorePrivateShowPermissionPromptForDelegatedInstallFunction() override; 179 ~WebstorePrivateShowPermissionPromptForDelegatedInstallFunction() override;
179 180
180 void ShowPrompt(ExtensionInstallPrompt* install_prompt) override; 181 void ShowPrompt(ExtensionInstallPrompt* install_prompt) override;
181 scoped_ptr<base::ListValue> CreateResults( 182 scoped_ptr<base::ListValue> CreateResults(
182 api::webstore_private::Result result) const override; 183 api::webstore_private::Result result) const override;
183 }; 184 };
184 185
186 class WebstorePrivateInstallBundleFunction
187 : public UIThreadExtensionFunction,
188 public WebstoreInstallHelper::Delegate {
189 public:
190 DECLARE_EXTENSION_FUNCTION("webstorePrivate.installBundle",
191 WEBSTOREPRIVATE_INSTALLBUNDLE)
192
193 WebstorePrivateInstallBundleFunction();
194
195 private:
196 ~WebstorePrivateInstallBundleFunction() override;
197
198 // ExtensionFunction:
199 ExtensionFunction::ResponseAction Run() override;
200
201 // WebstoreInstallHelper::Delegate:
202 void OnWebstoreParseSuccess(const std::string& id,
203 const SkBitmap& icon,
204 base::DictionaryValue* parsed_manifest) override;
205 void OnWebstoreParseFailure(const std::string& id,
206 InstallHelperResultCode result_code,
207 const std::string& error_message) override;
208
209 void OnInstallApproval(BundleInstaller::ApprovalState state);
210 void OnInstallComplete();
211
212 ChromeExtensionFunctionDetails chrome_details_;
213
214 // This stores the input parameters to the function.
215 scoped_ptr<api::webstore_private::InstallBundle::Params> params_;
216
217 scoped_ptr<extensions::BundleInstaller> bundle_;
218 };
219
185 class WebstorePrivateEnableAppLauncherFunction 220 class WebstorePrivateEnableAppLauncherFunction
186 : public UIThreadExtensionFunction { 221 : public UIThreadExtensionFunction {
187 public: 222 public:
188 DECLARE_EXTENSION_FUNCTION("webstorePrivate.enableAppLauncher", 223 DECLARE_EXTENSION_FUNCTION("webstorePrivate.enableAppLauncher",
189 WEBSTOREPRIVATE_ENABLEAPPLAUNCHER) 224 WEBSTOREPRIVATE_ENABLEAPPLAUNCHER)
190 225
191 WebstorePrivateEnableAppLauncherFunction(); 226 WebstorePrivateEnableAppLauncherFunction();
192 227
193 private: 228 private:
194 ~WebstorePrivateEnableAppLauncherFunction() override; 229 ~WebstorePrivateEnableAppLauncherFunction() override;
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 private: 373 private:
339 ~WebstorePrivateGetEphemeralAppsEnabledFunction() override; 374 ~WebstorePrivateGetEphemeralAppsEnabledFunction() override;
340 375
341 // ExtensionFunction: 376 // ExtensionFunction:
342 ExtensionFunction::ResponseAction Run() override; 377 ExtensionFunction::ResponseAction Run() override;
343 }; 378 };
344 379
345 } // namespace extensions 380 } // namespace extensions
346 381
347 #endif // CHROME_BROWSER_EXTENSIONS_API_WEBSTORE_PRIVATE_WEBSTORE_PRIVATE_API_H _ 382 #endif // CHROME_BROWSER_EXTENSIONS_API_WEBSTORE_PRIVATE_WEBSTORE_PRIVATE_API_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698