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

Unified Diff: chrome/browser/extensions/webstore_standalone_installer.h

Issue 339103002: Update the EphemeralAppLauncher for use by the webstorePrivate API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase again Created 6 years, 6 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/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>;
« no previous file with comments | « chrome/browser/extensions/webstore_installer_test.cc ('k') | chrome/browser/extensions/webstore_standalone_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698