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

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: Fix test 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 6c64cca7e815e66eef55ca3c09ae1f6b92f37e1d..6622dddfd6e9748b9e2296d429a3769e559b7b0b 100644
--- a/chrome/browser/extensions/install_observer.h
+++ b/chrome/browser/extensions/install_observer.h
@@ -33,34 +33,43 @@ class InstallObserver {
// 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);
+ virtual void OnBeginExtensionInstall(const ExtensionInstallParams& params) {}
+
+ // Called when the Extension begins the download process. This typically
+ // happens right after OnBeginExtensionInstall(), unless the extension has
+ // already been downloaded.
+ 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);
+ 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);
+ virtual void OnInstallFailure(const std::string& extension_id) {}
// Called if the installation succeeds.
- virtual void OnExtensionInstalled(const Extension* extension);
+ virtual void OnExtensionInstalled(const Extension* extension) {}
// 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 OnExtensionLoaded(const Extension* extension) {}
+ virtual void OnExtensionUnloaded(const Extension* extension) {}
+ virtual void OnExtensionUninstalled(const Extension* extension) {}
+ virtual void OnAppInstalledToAppList(const std::string& extension_id) {}
// Called when the app list is reordered.
- virtual void OnAppsReordered();
+ virtual void OnAppsReordered() {}
// Notifies observers that the observed object is going away.
- virtual void OnShutdown();
+ virtual void OnShutdown() {}
protected:
virtual ~InstallObserver() {}

Powered by Google App Engine
This is Rietveld 408576698