Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(564)

Unified Diff: ash/metrics/user_metrics_recorder.cc

Issue 2331093002: UMA stats for stylus usage (Closed)
Patch Set: nit and rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/metrics/user_metrics_recorder.h ('k') | ash/mus/bridge/wm_window_mus.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/metrics/user_metrics_recorder.cc
diff --git a/ash/metrics/user_metrics_recorder.cc b/ash/metrics/user_metrics_recorder.cc
index 0156819022bd5621f4a85e87c0933528b0991238..8959e6939763d71b4752479c416748a4bb37f17d 100644
--- a/ash/metrics/user_metrics_recorder.cc
+++ b/ash/metrics/user_metrics_recorder.cc
@@ -18,10 +18,15 @@
#include "ash/metrics/desktop_task_switch_metric_recorder.h"
#include "ash/shell.h"
#include "ash/wm/window_state_aura.h"
+#include "base/memory/ptr_util.h"
#include "base/metrics/histogram.h"
#include "base/metrics/user_metrics.h"
#include "ui/aura/window.h"
+#if defined(OS_CHROMEOS)
+#include "ash/common/metrics/pointer_metrics_recorder.h"
+#endif
+
namespace ash {
namespace {
@@ -595,10 +600,20 @@ void UserMetricsRecorder::OnShellInitialized() {
desktop_task_switch_metric_recorder_.reset(
new DesktopTaskSwitchMetricRecorder());
}
+#if defined(OS_CHROMEOS)
+ pointer_metrics_recorder_ = base::MakeUnique<PointerMetricsRecorder>();
+#endif
}
void UserMetricsRecorder::OnShellShuttingDown() {
desktop_task_switch_metric_recorder_.reset();
+
+#if defined(OS_CHROMEOS)
+ // To clean up pointer_metrics_recorder_ properly, a valid shell instance is
+ // required, so explicitly delete it before the shell instance becomes
+ // invalid.
+ pointer_metrics_recorder_.reset();
+#endif
}
void UserMetricsRecorder::RecordPeriodicMetrics() {
« no previous file with comments | « ash/metrics/user_metrics_recorder.h ('k') | ash/mus/bridge/wm_window_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698