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

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

Issue 176883003: Make InstallObserver methods not pure-virtual (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..6c64cca7e815e66eef55ca3c09ae1f6b92f37e1d 100644
--- a/chrome/browser/extensions/install_observer.h
+++ b/chrome/browser/extensions/install_observer.h
@@ -31,23 +31,36 @@ 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 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);
- virtual void OnInstallFailure(const std::string& extension_id) = 0;
+ // Called if the extension fails to install.
+ virtual void OnInstallFailure(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 if the installation succeeds.
+ 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);
+
+ // 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() {}
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.cc ('k') | chrome/browser/extensions/install_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698