[Pwa]: Switch to new filter functions that query on Capabilities.
Target(s): chrome/browser/devtools
This updates callsites for FindBestAppWithUrlInScope and for
FindAllAppsNestedInUrl to use the new versions that allows for
querying the web app registry for apps with certain capabilities
(such as how it opens, browser tab/dedicated window, supports
badging/notifications, etc).
It replaces similar functions that deal with install state, which
is error prone and confusing for consumers of the API.
The prototype with more discussion threads can be found here:
https://chromium-review.googlesource.com/c/chromium/src/+/6167649
This CL was uploaded by git cl split.
R=caseq@chromium.org
Bug: 390167210
Change-Id: Icbbb49238a5b0c8153f7e0d2905f00a41b6949ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6180270
Auto-Submit: Finnur Thorarinsson <finnur@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Danil Somsikov <dsv@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1408595}
diff --git a/chrome/browser/devtools/chrome_devtools_manager_delegate.cc b/chrome/browser/devtools/chrome_devtools_manager_delegate.cc
index f49641d..c27eaca2 100644
--- a/chrome/browser/devtools/chrome_devtools_manager_delegate.cc
+++ b/chrome/browser/devtools/chrome_devtools_manager_delegate.cc
@@ -316,15 +316,10 @@
if (auto* web_app_provider =
web_app::WebAppProvider::GetForWebApps(profile)) {
- // TODO(crbug.com/340952100): Evaluate call sites of
- // FindBestAppWithUrlInScope for correctness.
std::optional<webapps::AppId> app_id =
web_app_provider->registrar_unsafe().FindBestAppWithUrlInScope(
rfh->GetMainFrame()->GetLastCommittedURL(),
- {
- web_app::proto::InstallState::INSTALLED_WITH_OS_INTEGRATION,
- web_app::proto::InstallState::INSTALLED_WITHOUT_OS_INTEGRATION,
- });
+ web_app::WebAppFilter::InstalledInChrome());
if (app_id) {
const auto* web_app =
web_app_provider->registrar_unsafe().GetAppById(app_id.value());