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

Unified Diff: extensions/browser/extension_registry_observer.h

Issue 279073003: Add a function triggering extension installed to ExtensionRegistryObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback3 Created 6 years, 7 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: extensions/browser/extension_registry_observer.h
diff --git a/extensions/browser/extension_registry_observer.h b/extensions/browser/extension_registry_observer.h
index 5880add25e63307af4691dae2e4bc98bdbcd7b99..6ad066614d3e3ed8bba0cfc8af560c2d1f74a79a 100644
--- a/extensions/browser/extension_registry_observer.h
+++ b/extensions/browser/extension_registry_observer.h
@@ -33,6 +33,21 @@ class ExtensionRegistryObserver {
virtual void OnExtensionUnloaded(content::BrowserContext* browser_context,
const Extension* extension,
UnloadedExtensionInfo::Reason reason) {}
+
+ // Called when |extension| is about to be installed. |is_update| is true if
+ // the installation is the result of it updating, in which case |old_name| is
+ // the name of the extension's previous version.
+ // The ExtensionRegistry will not be tracking |extension| at the time this
+ // event is fired, but will be immediately afterwards (note: not necessarily
+ // enabled; it might be installed in the disabled or even blacklisted sets,
+ // for example).
+ // Note that it's much more common to care about extensions being loaded
+ // (OnExtensionLoaded).
+ virtual void OnExtensionWillBeInstalled(
+ content::BrowserContext* browser_context,
+ const Extension* extension,
+ bool is_update,
+ const std::string& old_name) {}
};
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698