Commit 014cd0e7 authored by Giovanni Ortuño Urquidi's avatar Giovanni Ortuño Urquidi Committed by Commit Bot

desktop-pwas: Only check ENABLED extensions when installing new ones

BookmarkApps can only be ENABLED or inexistent, so it doesn't make sense
to query all extensions; querying ENABLED should be enough.

Bug: 916381
Change-Id: I232514d79a5a4413a6e400280b4e1eaec0f3da8c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1502314
Commit-Queue: Giovanni Ortuño Urquidi <ortuno@chromium.org>
Reviewed-by: default avatarAlexey Baskakov <loyso@chromium.org>
Cr-Commit-Position: refs/heads/master@{#637617}
parent 1b9eb71c
...@@ -26,8 +26,9 @@ void BookmarkAppRegistrar::Init(base::OnceClosure callback) { ...@@ -26,8 +26,9 @@ void BookmarkAppRegistrar::Init(base::OnceClosure callback) {
} }
bool BookmarkAppRegistrar::IsInstalled(const web_app::AppId& app_id) const { bool BookmarkAppRegistrar::IsInstalled(const web_app::AppId& app_id) const {
return ExtensionRegistry::Get(profile_)->GetInstalledExtension(app_id) != auto* app =
nullptr; ExtensionRegistry::Get(profile_)->enabled_extensions().GetByID(app_id);
return app != nullptr;
} }
bool BookmarkAppRegistrar::WasExternalAppUninstalledByUser( bool BookmarkAppRegistrar::WasExternalAppUninstalledByUser(
......
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