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

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

Issue 175263003: Add chrome.webstore API methods to allow sites to see progress of installation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/install_observer.h
diff --git a/chrome/browser/extensions/install_observer.h b/chrome/browser/extensions/install_observer.h
index fe4b7dc57706f31f5693efb624fd650644b39c20..6f3097743825f8bee53bc9caaa32659b01803922 100644
--- a/chrome/browser/extensions/install_observer.h
+++ b/chrome/browser/extensions/install_observer.h
@@ -31,23 +31,46 @@ class InstallObserver {
bool is_ephemeral;
};
- virtual void OnBeginExtensionInstall(
- const ExtensionInstallParams& params) = 0;
+ // Called at the beginning of the complete installation process, i.e., this
+ // is called before the extension download begins.
+ virtual void OnBeginExtensionInstall(const ExtensionInstallParams& params);
+ // Called when the Extension begins the download process.
+ // This is typically, but not always, almost immediately after
+ // OnBeginExtensionInstall(). In some cases, though, the extension may already
+ // be downloaded, so we don't want to group the two together incorrectly.
+ virtual void OnBeginExtensionDownload(const std::string& extension_id);
+
+ // Called whenever the extension download is updated.
+ // Note: Some extensions have multiple modules, so the percent included here
+ // is a simple calculation of:
+ // (finished_files * 100 + current_file_progress) / (total files * 100).
virtual void OnDownloadProgress(const std::string& extension_id,
- int percent_downloaded) = 0;
+ int percent_downloaded);
+
+ // Called when the necessary downloads have completed, and the crx
+ // installation is due to start.
+ virtual void OnBeginCrxInstall(const std::string& extension_id);
+
+ // Called if the extension fails to install.
+ virtual void OnInstallFailure(const std::string& extension_id);
+
+ // Called if the installation succeeds.
+ virtual void OnExtensionInstalled(const Extension* extension);
- virtual void OnInstallFailure(const std::string& extension_id) = 0;
+ // Called when an extension is [Loaded, Unloaded, Uninstalled] or an app is
+ // installed to the app list. These are simply forwarded from the
+ // chrome::NOTIFICATIONs.
+ virtual void OnExtensionLoaded(const Extension* extension);
+ virtual void OnExtensionUnloaded(const Extension* extension);
+ virtual void OnExtensionUninstalled(const Extension* extension);
+ virtual void OnAppInstalledToAppList(const std::string& extension_id);
- virtual void OnExtensionInstalled(const Extension* extension) = 0;
- virtual void OnExtensionLoaded(const Extension* extension) = 0;
- virtual void OnExtensionUnloaded(const Extension* extension) = 0;
- virtual void OnExtensionUninstalled(const Extension* extension) = 0;
- virtual void OnAppsReordered() = 0;
- virtual void OnAppInstalledToAppList(const std::string& extension_id) = 0;
+ // Called when the app list is reordered.
+ virtual void OnAppsReordered();
// Notifies observers that the observed object is going away.
- virtual void OnShutdown() = 0;
+ virtual void OnShutdown();
protected:
virtual ~InstallObserver() {}

Powered by Google App Engine
This is Rietveld 408576698