Skip to content

Commit 0101005

Browse files
Nancy WangChromium LUCI CQ
authored andcommitted
Remove window count metrics.
WindowCount metrics are used to record how many windows have been created when the user takes action on the full restore notification, to provide the user usage data to help make the ui decision. Full restore has launched in M94, and we have got the new ui review decision. So WindowCount metrics can be removed. BUG=1146900 Change-Id: Ifb4c19af2f078a27e05ae883b484102fb0a3b8f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3216775 Reviewed-by: Sammie Quon <[email protected]> Reviewed-by: Xiyuan Xia <[email protected]> Commit-Queue: Nancy Wang <[email protected]> Cr-Commit-Position: refs/heads/main@{#930211}
1 parent ddaf4ad commit 0101005

File tree

5 files changed

+23
-31
lines changed

5 files changed

+23
-31
lines changed

chrome/browser/ash/app_restore/full_restore_service.cc

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ const char kRestoreForCrashNotificationHistogramName[] =
5050
const char kRestoreSettingHistogramName[] = "Apps.RestoreSetting";
5151
const char kRestoreInitSettingHistogramName[] = "Apps.RestoreInitSetting";
5252

53-
constexpr char kWindowCountHistogramPrefix[] = "Apps.WindowCount.";
54-
constexpr char kRestoreHistogramSuffix[] = "Restore";
55-
constexpr char kNotRestoreHistogramSuffix[] = "NotRestore";
56-
constexpr char kCloseByUserHistogramSuffix[] = "CloseByUser";
57-
constexpr char kCloseNotByUserHistogramSuffix[] = "CloseNotByUser";
58-
5953
// static
6054
FullRestoreService* FullRestoreService::GetForProfile(Profile* profile) {
6155
return static_cast<FullRestoreService*>(
@@ -221,8 +215,6 @@ void FullRestoreService::Close(bool by_user) {
221215
RecordRestoreAction(
222216
notification_->id(),
223217
by_user ? RestoreAction::kCloseByUser : RestoreAction::kCloseNotByUser);
224-
RecordWindowCount(by_user ? kCloseByUserHistogramSuffix
225-
: kCloseNotByUserHistogramSuffix);
226218
}
227219
notification_ = nullptr;
228220

@@ -247,7 +239,6 @@ void FullRestoreService::Click(const absl::optional<int>& button_index,
247239

248240
// Restore if the user clicks the notification body.
249241
RecordRestoreAction(notification_->id(), RestoreAction::kRestore);
250-
RecordWindowCount(kRestoreHistogramSuffix);
251242
Restore();
252243

253244
// If the user selects restore, don't start the save timer. Wait for the
@@ -270,7 +261,6 @@ void FullRestoreService::Click(const absl::optional<int>& button_index,
270261
// Close the crash notification if the user clicks the cancel button of the
271262
// crash notification.
272263
RecordRestoreAction(notification_->id(), RestoreAction::kCancel);
273-
RecordWindowCount(kNotRestoreHistogramSuffix);
274264
MaybeCloseNotification();
275265
}
276266

@@ -456,12 +446,6 @@ bool FullRestoreService::ShouldShowNotification() {
456446
!::first_run::IsChromeFirstRun() && !close_notification_;
457447
}
458448

459-
void FullRestoreService::RecordWindowCount(const std::string& restore_action) {
460-
base::UmaHistogramCounts100(
461-
kWindowCountHistogramPrefix + restore_action,
462-
::full_restore::FullRestoreSaveHandler::GetInstance()->window_count());
463-
}
464-
465449
ScopedRestoreForTesting::ScopedRestoreForTesting() {
466450
g_restore_for_testing = false;
467451
}

chrome/browser/ash/app_restore/full_restore_service.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,6 @@ class FullRestoreService : public KeyedService,
126126
// Chrome is run. Otherwise, returns false.
127127
bool ShouldShowNotification();
128128

129-
// Records the new window count when the user takes action on the full restore
130-
// notification.
131-
void RecordWindowCount(const std::string& restore_action);
132-
133129
Profile* profile_ = nullptr;
134130
PrefChangeRegistrar pref_change_registrar_;
135131

components/app_restore/full_restore_save_handler.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,13 @@ void FullRestoreSaveHandler::OnWindowInitialized(aura::Window* window) {
107107
if (arc_save_handler_)
108108
arc_save_handler_->OnWindowInitialized(window);
109109

110-
++window_count_;
111110
return;
112111
}
113112

114113
int32_t window_id = window->GetProperty(app_restore::kWindowIdKey);
115114
if (!SessionID::IsValidValue(window_id))
116115
return;
117116

118-
++window_count_;
119117
observed_windows_.AddObservation(window);
120118

121119
std::string* app_id_str = window->GetProperty(app_restore::kAppIdKey);

components/app_restore/full_restore_save_handler.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,6 @@ class COMPONENT_EXPORT(APP_RESTORE) FullRestoreSaveHandler
170170
// the window's associated AppRestoreData.
171171
std::string GetAppId(aura::Window* window);
172172

173-
int window_count() const { return window_count_; }
174-
175173
base::OneShotTimer* GetTimerForTesting() { return &save_timer_; }
176174

177175
// Since this is a singleton, tests may need to clear it between tests.
@@ -281,9 +279,6 @@ class COMPONENT_EXPORT(APP_RESTORE) FullRestoreSaveHandler
281279
// permit `save_timer_` to start periodically triggering saving to disk.
282280
bool allow_save_ = false;
283281

284-
// The number of window created. This is used for metrics only.
285-
int window_count_ = 0;
286-
287282
base::ScopedObservation<aura::Env, aura::EnvObserver> env_observer_{this};
288283

289284
base::ScopedMultiSourceObservation<aura::Window, aura::WindowObserver>

tools/metrics/histograms/metadata/apps/histograms.xml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,27 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
141141

142142
<variants name="RestoreAction">
143143
<variant name="CloseByUser"
144-
summary="The full restore notfication is closed by user"/>
144+
summary="The full restore notfication is closed by user">
145+
<obsolete>
146+
Removed October 2021.
147+
</obsolete>
148+
</variant>
145149
<variant name="CloseNotByUser"
146-
summary="The full restore notfication is not closed by user"/>
147-
<variant name="NotRestore" summary="No thanks is clicked"/>
148-
<variant name="Restore" summary="Restore is clicked"/>
150+
summary="The full restore notfication is not closed by user">
151+
<obsolete>
152+
Removed October 2021.
153+
</obsolete>
154+
</variant>
155+
<variant name="NotRestore" summary="No thanks is clicked">
156+
<obsolete>
157+
Removed October 2021.
158+
</obsolete>
159+
</variant>
160+
<variant name="Restore" summary="Restore is clicked">
161+
<obsolete>
162+
Removed October 2021.
163+
</obsolete>
164+
</variant>
149165
</variants>
150166

151167
<histogram name="Apps.ActivatedCount.{AppType}" units="units"
@@ -2822,6 +2838,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
28222838

28232839
<histogram name="Apps.WindowCount.{RestoreAction}" units="unit"
28242840
expires_after="2021-12-30">
2841+
<obsolete>
2842+
Removed October 2021.
2843+
</obsolete>
28252844
<owner>[email protected]</owner>
28262845
<owner>[email protected]</owner>
28272846
<summary>

0 commit comments

Comments
 (0)