Commit 95e472ca authored by Alan Cutter's avatar Alan Cutter Committed by Commit Bot

Filter out non-bookmark extensions from web app install/uninstall events

This is a future proofing bug fix. BookmarkAppRegistrar was not filtering
its extensions for only bookmark app extensions and would fire for any
extension install.

This wasn't an issue because the only listener at the moment
(WebAppTabHelperBase::OnWebAppInstalled) already filters to PWAs only via
FindAppIdInScopeOfUrl().

This change ensures we don't over signal for any future listeners.

Bug: 891172
Change-Id: Id8bcf275326a03819658eca8d36d5cbffec2ba5a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1600534
Commit-Queue: Alan Cutter <alancutter@chromium.org>
Auto-Submit: Alan Cutter <alancutter@chromium.org>
Reviewed-by: default avatarGiovanni Ortuño Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#657589}
parent 7360c106
......@@ -89,14 +89,18 @@ void BookmarkAppRegistrar::OnExtensionInstalled(
content::BrowserContext* browser_context,
const extensions::Extension* extension,
bool is_update) {
NotifyWebAppInstalled(extension->id());
DCHECK_EQ(browser_context, profile());
if (extension->from_bookmark())
NotifyWebAppInstalled(extension->id());
}
void BookmarkAppRegistrar::OnExtensionUninstalled(
content::BrowserContext* browser_context,
const extensions::Extension* extension,
extensions::UninstallReason reason) {
NotifyWebAppUninstalled(extension->id());
DCHECK_EQ(browser_context, profile());
if (extension->from_bookmark())
NotifyWebAppUninstalled(extension->id());
}
void BookmarkAppRegistrar::OnShutdown(ExtensionRegistry* registry) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment