Skip to content

Commit

Permalink
Remove UMA Webapp.AmbientBadge.*
Browse files Browse the repository at this point in the history
Remove Webapp.AmbientBadge.Display/Dismiss/Click
Keep Webapp.AmbientBadge.Terminate


OBSOLETE_HISTOGRAMS=no longer used

Bug: 354712669
Change-Id: Ib0313a3c7e6d940b8b8956989e22902b706cef0f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5730837
Commit-Queue: Daniel Murphy <dmurph@chromium.org>
Auto-Submit: Ella Ge <eirage@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1331418}
  • Loading branch information
EiraGe authored and pull[bot] committed Jul 23, 2024
1 parent ec5caca commit 75a6d2d
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 104 deletions.
2 changes: 0 additions & 2 deletions components/webapps/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ source_set("browser") {
"android/add_to_homescreen_params.h",
"android/ambient_badge_manager.cc",
"android/ambient_badge_manager.h",
"android/ambient_badge_metrics.cc",
"android/ambient_badge_metrics.h",
"android/app_banner_manager_android.cc",
"android/app_banner_manager_android.h",
"android/bottomsheet/pwa_bottom_sheet_controller.cc",
Expand Down
10 changes: 4 additions & 6 deletions components/webapps/browser/android/ambient_badge_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
#include <string>

#include "base/feature_list.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "components/prefs/pref_service.h"
#include "components/segmentation_platform/public/constants.h"
#include "components/segmentation_platform/public/input_context.h"
#include "components/segmentation_platform/public/result.h"
#include "components/segmentation_platform/public/segmentation_platform_service.h"
#include "components/webapps/browser/android/add_to_homescreen_params.h"
#include "components/webapps/browser/android/ambient_badge_metrics.h"
#include "components/webapps/browser/android/app_banner_manager_android.h"
#include "components/webapps/browser/android/install_prompt_prefs.h"
#include "components/webapps/browser/android/shortcut_info.h"
Expand All @@ -32,6 +32,8 @@ namespace {

constexpr char kSegmentationResultHistogramName[] =
"WebApk.InstallPrompt.SegmentationResult";
constexpr char kAmbientBadgeTerminateHistogram[] =
"Webapp.AmbientBadge.Terminate";

// This enum is used to back UMA histograms, Entries should not be renumbered
// and numeric values should never be reused.
Expand All @@ -57,7 +59,7 @@ AmbientBadgeManager::AmbientBadgeManager(
pref_service_(prefs) {}

AmbientBadgeManager::~AmbientBadgeManager() {
RecordAmbientBadgeTeminateState(state_);
base::UmaHistogramEnumeration(kAmbientBadgeTerminateHistogram, state_);
}

void AmbientBadgeManager::MaybeShow(
Expand All @@ -83,7 +85,6 @@ void AmbientBadgeManager::MaybeShow(

void AmbientBadgeManager::AddToHomescreenFromBadge() {
CHECK(a2hs_params_);
RecordAmbientBadgeClickEvent(a2hs_params_->app_type);
InstallPromptPrefs::RecordInstallPromptClicked(pref_service());
std::move(show_banner_callback_).Run();
}
Expand All @@ -97,7 +98,6 @@ void AmbientBadgeManager::BadgeDismissed() {

InstallPromptPrefs::RecordInstallPromptDismissed(
pref_service(), AppBannerManager::GetCurrentTime());
RecordAmbientBadgeDismissEvent(a2hs_params_->app_type);
UpdateState(State::kDismissed);
}

Expand All @@ -110,7 +110,6 @@ void AmbientBadgeManager::BadgeIgnored() {

InstallPromptPrefs::RecordInstallPromptIgnored(
pref_service(), AppBannerManager::GetCurrentTime());
RecordAmbientBadgeDismissEvent(a2hs_params_->app_type);
UpdateState(State::kDismissed);
}

Expand Down Expand Up @@ -228,7 +227,6 @@ void AmbientBadgeManager::ShowAmbientBadge() {
return;
}

RecordAmbientBadgeDisplayEvent(a2hs_params_->app_type);
UpdateState(State::kShowing);

WebappInstallSource install_source = InstallableMetrics::GetInstallSource(
Expand Down
39 changes: 0 additions & 39 deletions components/webapps/browser/android/ambient_badge_metrics.cc

This file was deleted.

20 changes: 0 additions & 20 deletions components/webapps/browser/android/ambient_badge_metrics.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "base/memory/weak_ptr.h"
#include "base/types/expected.h"
#include "components/webapps/browser/android/add_to_homescreen_installer.h"
#include "components/webapps/browser/android/ambient_badge_metrics.h"
#include "components/webapps/browser/android/installable/installable_ambient_badge_client.h"
#include "components/webapps/browser/android/installable/installable_ambient_badge_message_controller.h"
#include "components/webapps/browser/banners/app_banner_manager.h"
Expand Down
36 changes: 0 additions & 36 deletions tools/metrics/histograms/metadata/webapps/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -232,42 +232,6 @@ chromium-metrics-reviews@google.com.
</summary>
</histogram>

<histogram name="Webapp.AmbientBadge.Click" enum="InstallAmbientBadgeAppType"
expires_after="2024-09-01">
<owner>eirage@chromium.org</owner>
<owner>src/chrome/android/webapk/OWNERS</owner>
<summary>
On mobile, an install ambient badge may automatically shows to promote an
application related to the current website when the site meets all install
criteria. When the ambient badge was clicked by the user and displaying the
app banner UI, record the type of the app (native app or web app).
</summary>
</histogram>

<histogram name="Webapp.AmbientBadge.Dismiss" enum="InstallAmbientBadgeAppType"
expires_after="2024-09-01">
<owner>eirage@chromium.org</owner>
<owner>src/chrome/android/webapk/OWNERS</owner>
<summary>
On mobile, an install ambient badge may automatically shows to promote an
application related to the current website when the site meets all install
criteria. When the ambient badge was explictly dismissed by the user, record
the type of the app (native app or web app).
</summary>
</histogram>

<histogram name="Webapp.AmbientBadge.Display" enum="InstallAmbientBadgeAppType"
expires_after="2024-09-01">
<owner>eirage@chromium.org</owner>
<owner>src/chrome/android/webapk/OWNERS</owner>
<summary>
On mobile, an install ambient badge may automatically shows to promote an
application related to the current website when the site meets all install
criteria. When an ambient badge was shown, record the type of the app
(native app or web app).
</summary>
</histogram>

<histogram name="Webapp.AmbientBadge.Terminate"
enum="InstallableAmbientBadgeState" expires_after="2025-01-05">
<owner>eirage@chromium.org</owner>
Expand Down

0 comments on commit 75a6d2d

Please sign in to comment.