Commit 09e40f57 authored by Giovanni Ortuño Urquidi's avatar Giovanni Ortuño Urquidi Committed by Commit Bot

desktop-pwas: Move recording before FinalizeInstall call

Install events are recorded regardless of the install result so move
the call to record them before the FinalizeInstall call.

Bug: 915043
Change-Id: I5b43e697137471a195fa9909706ce567ac43e56f
Reviewed-on: https://chromium-review.googlesource.com/c/1481148Reviewed-by: default avatarAlexey Baskakov <loyso@chromium.org>
Commit-Queue: Giovanni Ortuño Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#634426}
parent a41d6f40
......@@ -190,6 +190,14 @@ void WebAppInstallManager::OnDialogCompleted(
WebApplicationInfo web_app_info_copy = *web_app_info;
DCHECK(install_source_ != kNoInstallSource);
// This metric is recorded regardless of the installation result.
if (InstallableMetrics::IsReportableInstallSource(install_source_) &&
for_installable_site == ForInstallableSite::kYes) {
InstallableMetrics::TrackInstallEvent(install_source_);
}
install_finalizer_->FinalizeInstall(
web_app_info_copy,
base::BindOnce(&WebAppInstallManager::OnInstallFinalized,
......@@ -198,15 +206,6 @@ void WebAppInstallManager::OnDialogCompleted(
// Check that the finalizer hasn't called OnInstallFinalized synchronously:
DCHECK(install_callback_);
DCHECK(install_source_ != kNoInstallSource);
// In BookmarkAppHelper this tracking happens right after
// crx_installer_->InstallWebApp call (not in FinishInstallation).
// TODO(loyso): Consider to shift this recording to OnInstallFinalized.
if (InstallableMetrics::IsReportableInstallSource(install_source_) &&
for_installable_site == ForInstallableSite::kYes) {
InstallableMetrics::TrackInstallEvent(install_source_);
}
}
void WebAppInstallManager::OnInstallFinalized(
......
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