Add a function triggering extension installed to ExtensionRegistryObserver.
This can be replace chrome::NOTIFICATION_EXTENSION_INSTALLED with ExtensionRegistryObserver.
And apply it to WebStoreInstaller and InstallTracker.
[email protected]
BUG=354459
TEST=unit_test, manual(install app from webstore)
Review URL: https://codereview.chromium.org/279073003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272143 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/extensions/browser/extension_registry.h b/extensions/browser/extension_registry.h
index d8df24b36..65ee7517 100644
--- a/extensions/browser/extension_registry.h
+++ b/extensions/browser/extension_registry.h
@@ -74,6 +74,14 @@
void TriggerOnUnloaded(const Extension* extension,
UnloadedExtensionInfo::Reason reason);
+ // If this is a fresh install then |is_update| is false and there must not be
+ // any installed extension with |extension|'s ID. If this is an update then
+ // |is_update| is true and must be an installed extension with |extension|'s
+ // ID, and |old_name| must be non-empty.
+ void TriggerOnWillBeInstalled(const Extension* extension,
+ bool is_update,
+ const std::string& old_name);
+
// Find an extension by ID using |include_mask| to pick the sets to search:
// * enabled_extensions() --> ExtensionRegistry::ENABLED
// * disabled_extensions() --> ExtensionRegistry::DISABLED