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 e61cdb0fef8c4bc3f69864e28c3b7670f79fe59c..151bb4705e13fc74ca5d4a60eb0a7d30135274a9 100644 |
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.h |
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.h |
@@ -9,6 +9,7 @@ |
#include "chrome/browser/extensions/active_install_data.h" |
#include "chrome/browser/extensions/chrome_extension_function.h" |
+#include "chrome/browser/extensions/chrome_extension_function_details.h" |
#include "chrome/browser/extensions/extension_install_prompt.h" |
#include "chrome/browser/extensions/webstore_install_helper.h" |
#include "chrome/browser/extensions/webstore_installer.h" |
@@ -44,7 +45,7 @@ class WebstorePrivateApi { |
}; |
class WebstorePrivateBeginInstallWithManifest3Function |
- : public ChromeAsyncExtensionFunction, |
+ : public UIThreadExtensionFunction, |
public ExtensionInstallPrompt::Delegate, |
public WebstoreInstallHelper::Delegate { |
public: |
@@ -84,6 +85,12 @@ class WebstorePrivateBeginInstallWithManifest3Function |
WebstorePrivateBeginInstallWithManifest3Function(); |
+ private: |
+ ~WebstorePrivateBeginInstallWithManifest3Function() override; |
+ |
+ // ExtensionFunction: |
+ ExtensionFunction::ResponseAction Run() override; |
+ |
// WebstoreInstallHelper::Delegate: |
void OnWebstoreParseSuccess(const std::string& id, |
const SkBitmap& icon, |
@@ -96,19 +103,21 @@ class WebstorePrivateBeginInstallWithManifest3Function |
void InstallUIProceed() override; |
void InstallUIAbort(bool user_initiated) override; |
- protected: |
- ~WebstorePrivateBeginInstallWithManifest3Function() override; |
- |
- // ExtensionFunction: |
- bool RunAsync() override; |
+ // Response helpers. |
+ const char* ResultCodeToString(ResultCode code) const; |
+ ExtensionFunction::ResponseValue BuildResponseForSuccess(); |
+ ExtensionFunction::ResponseValue BuildResponseForError( |
+ ResultCode code, const std::string& error); |
- // Sets the result_ as a string based on |code|. |
- void SetResultCode(ResultCode code); |
+ // Convenience response methods. |
+ ExtensionFunction::ResponseAction RespondNowWithError( |
+ ResultCode code, const std::string& error); |
+ void RespondWithSuccess(); |
+ void RespondWithError(ResultCode code, const std::string& error); |
- private: |
- const char* ResultCodeToString(ResultCode code); |
+ ChromeExtensionFunctionDetails chrome_details_; |
- // These store the input parameters to the function. |
+ // This stores the input parameters to the function. |
scoped_ptr<api::webstore_private::BeginInstallWithManifest3::Params> params_; |
// The results of parsing manifest_ and icon_data_ go into these two. |