Index: chrome/browser/extensions/webstore_standalone_installer.h |
diff --git a/chrome/browser/extensions/webstore_standalone_installer.h b/chrome/browser/extensions/webstore_standalone_installer.h |
index ecbfa98c160ac0f8896d5ceb5e8bc76a348e85b6..7df7bff9f6322f76e83ccbd435849dc9c669a523 100644 |
--- a/chrome/browser/extensions/webstore_standalone_installer.h |
+++ b/chrome/browser/extensions/webstore_standalone_installer.h |
@@ -13,6 +13,7 @@ |
#include "chrome/browser/extensions/extension_install_prompt.h" |
#include "chrome/browser/extensions/webstore_data_fetcher_delegate.h" |
#include "chrome/browser/extensions/webstore_install_helper.h" |
+#include "chrome/browser/extensions/webstore_install_result.h" |
#include "chrome/browser/extensions/webstore_installer.h" |
#include "net/url_request/url_fetcher_delegate.h" |
#include "third_party/skia/include/core/SkBitmap.h" |
@@ -60,9 +61,20 @@ class WebstoreStandaloneInstaller |
protected: |
virtual ~WebstoreStandaloneInstaller(); |
+ // Called when the install should be aborted. The callback is cleared. |
void AbortInstall(); |
- void InvokeCallback(const std::string& error); |
- virtual void CompleteInstall(const std::string& error); |
+ |
+ // Called when the install is complete. |
+ virtual void CompleteInstall(webstore_install::Result result, |
+ const std::string& error); |
+ |
+ // Called when the installer should proceed to prompt the user. |
+ void ProceedWithInstallPrompt(); |
+ |
+ // Lazily creates a dummy extension for display from the parsed manifest. This |
+ // is safe to call from OnManifestParsed() onwards. The manifest may be |
+ // invalid, thus the caller must check that the return value is not NULL. |
+ scoped_refptr<const Extension> GetLocalizedExtensionForDisplay(); |
// Template Method's hooks to be implemented by subclasses. |
@@ -108,11 +120,12 @@ class WebstoreStandaloneInstaller |
const base::DictionaryValue& webstore_data, |
std::string* error) const = 0; |
- // Perform all necessary checks after the manifest has been parsed to make |
- // sure that the install should still proceed. |
- virtual bool CheckInstallValid( |
- const base::DictionaryValue& manifest, |
- std::string* error); |
+ // Will be called after the extension's manifest has been successfully parsed. |
+ // Subclasses can perform asynchronous checks at this point and call |
+ // ProceedWithInstallPrompt() to proceed with the install or otherwise call |
+ // CompleteInstall() with an error code. The default implementation calls |
+ // ProceedWithInstallPrompt(). |
+ virtual void OnManifestParsed(); |
// Returns an install UI to be shown. By default, this returns an install UI |
// that is a transient child of the host window for GetWebContents(). |
@@ -137,6 +150,9 @@ class WebstoreStandaloneInstaller |
Profile* profile() const { return profile_; } |
const std::string& id() const { return id_; } |
const base::DictionaryValue* manifest() const { return manifest_.get(); } |
+ const Extension* localized_extension_for_display() const { |
+ return localized_extension_for_display_.get(); |
+ } |
private: |
friend class base::RefCountedThreadSafe<WebstoreStandaloneInstaller>; |