Commit 55f6ecb9 authored by Dominick Ng's avatar Dominick Ng Committed by Commit Bot

Record the correct install source in BookmarkAppInstallationTask.

Prior to this CL, BookmarkAppInstallationTask exclusively passed
WebappInstallSource::MENU_BROWSER_TAB to BookmarkAppHelper, which would
eventually record the source in the Webapp.Install.InstallEvent metric.
This causes huge skew in the metric on Chrome OS, which uses the pending
queue for default installation.

This CL introduces new metric categories for the different default
install categories and updates BookmarkAppInstallationTask to use them,
correcting the skew.

BUG=942402

Change-Id: Iada40c6a918c095e35948ab8e73ff5da8726c7e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1525256
Commit-Queue: Dominick Ng <dominickn@chromium.org>
Reviewed-by: default avatarAlexey Baskakov <loyso@chromium.org>
Reviewed-by: default avatarGiovanni Ortuño Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#641119}
parent 72739caa
...@@ -232,7 +232,12 @@ bool InstallableMetrics::IsReportableInstallSource(WebappInstallSource source) { ...@@ -232,7 +232,12 @@ bool InstallableMetrics::IsReportableInstallSource(WebappInstallSource source) {
source == WebappInstallSource::API_CUSTOM_TAB || source == WebappInstallSource::API_CUSTOM_TAB ||
source == WebappInstallSource::DEVTOOLS || source == WebappInstallSource::DEVTOOLS ||
source == WebappInstallSource::AMBIENT_BADGE_BROWSER_TAB || source == WebappInstallSource::AMBIENT_BADGE_BROWSER_TAB ||
source == WebappInstallSource::AMBIENT_BADGE_CUSTOM_TAB; source == WebappInstallSource::AMBIENT_BADGE_CUSTOM_TAB ||
source == WebappInstallSource::ARC ||
source == WebappInstallSource::INTERNAL_DEFAULT ||
source == WebappInstallSource::EXTERNAL_DEFAULT ||
source == WebappInstallSource::EXTERNAL_POLICY ||
source == WebappInstallSource::SYSTEM_DEFAULT;
} }
// static // static
......
...@@ -80,6 +80,19 @@ enum class WebappInstallSource { ...@@ -80,6 +80,19 @@ enum class WebappInstallSource {
// Installation via ARC on Chrome OS. // Installation via ARC on Chrome OS.
ARC = 10, ARC = 10,
// An internal default-installed app on Chrome OS (i.e. triggered from code).
INTERNAL_DEFAULT = 11,
// An external default-installed app on Chrome OS (i.e. triggered from an
// external source file).
EXTERNAL_DEFAULT = 12,
// A policy-installed app on Chrome OS.
EXTERNAL_POLICY = 13,
// A system app installed on Chrome OS.
SYSTEM_DEFAULT = 14,
// Add any new values above this one. // Add any new values above this one.
COUNT, COUNT,
}; };
......
...@@ -96,10 +96,26 @@ void BookmarkAppInstallationTask::OnGetWebApplicationInfo( ...@@ -96,10 +96,26 @@ void BookmarkAppInstallationTask::OnGetWebApplicationInfo(
return; return;
} }
// TODO(crbug.com/864904): Use an appropriate install source once source auto install_source = WebappInstallSource::COUNT;
// is plumbed through this class. switch (app_info_.install_source) {
case web_app::InstallSource::kInternal:
install_source = WebappInstallSource::INTERNAL_DEFAULT;
break;
case web_app::InstallSource::kExternalDefault:
install_source = WebappInstallSource::EXTERNAL_DEFAULT;
break;
case web_app::InstallSource::kExternalPolicy:
install_source = WebappInstallSource::EXTERNAL_POLICY;
break;
case web_app::InstallSource::kSystemInstalled:
install_source = WebappInstallSource::SYSTEM_DEFAULT;
break;
case web_app::InstallSource::kArc:
NOTREACHED();
break;
}
helper_ = helper_factory_.Run(profile_, *web_app_info, web_contents, helper_ = helper_factory_.Run(profile_, *web_app_info, web_contents,
WebappInstallSource::MENU_BROWSER_TAB); install_source);
switch (app_info_.launch_container) { switch (app_info_.launch_container) {
case web_app::LaunchContainer::kDefault: case web_app::LaunchContainer::kDefault:
......
...@@ -56507,6 +56507,10 @@ Full version information for the fingerprint enum values: ...@@ -56507,6 +56507,10 @@ Full version information for the fingerprint enum values:
<int value="8" label="Ambient badge in an Android Custom Tab"/> <int value="8" label="Ambient badge in an Android Custom Tab"/>
<int value="9" label="Ambient badge in a browser tab"/> <int value="9" label="Ambient badge in a browser tab"/>
<int value="10" label="Via ARC on Chrome OS"/> <int value="10" label="Via ARC on Chrome OS"/>
<int value="11" label="Internal default-install on Chrome OS"/>
<int value="12" label="External default-install on Chrome OS"/>
<int value="13" label="Policy-install on Chrome OS"/>
<int value="14" label="System default app on Chrome OS"/>
</enum> </enum>
<enum name="WebappUninstallDialogAction"> <enum name="WebappUninstallDialogAction">
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