Commit 33a6ab0c authored by Alan Cutter's avatar Alan Cutter Committed by Commit Bot

desktop-pwas: Alert when clearing data for web apps with default scopes

This CL updates ImportantSitesUtil to include all web apps regardless of
manifest scope when it warns users about removing site data for origins
with high engagement scores.
Previously we would not include web apps whose scopes were set to
invalid values.

Bug: 910016
Change-Id: Idd7bca93a29b1752a1f8aa6bba3fcca1dc400ff0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2049585
Commit-Queue: Alan Cutter <alancutter@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#740577}
parent 2aed0cc7
...@@ -382,12 +382,11 @@ void PopulateInfoMapWithInstalled( ...@@ -382,12 +382,11 @@ void PopulateInfoMapWithInstalled(
auto app_ids = registrar.GetAppIds(); auto app_ids = registrar.GetAppIds();
std::map<std::string, std::string> installed_origins_map; std::map<std::string, std::string> installed_origins_map;
for (auto& app_id : app_ids) { for (auto& app_id : app_ids) {
auto scope = registrar.GetAppScopeInternal(app_id); GURL scope = registrar.GetAppScope(app_id);
if (scope) { DCHECK(scope.is_valid());
auto app_name = registrar.GetAppShortName(app_id); auto app_name = registrar.GetAppShortName(app_id);
installed_origins_map.emplace( installed_origins_map.emplace(
std::make_pair(scope.value().GetOrigin().spec(), app_name)); std::make_pair(scope.GetOrigin().spec(), app_name));
}
} }
for (const auto& detail : engagement_details) { for (const auto& detail : engagement_details) {
......
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