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

Unified Diff: ash/metrics/screen_event_task_switch_metric_recorder.h

Issue 1153633006: Added UMA statistics for changing the active window via click or touch events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
Index: ash/metrics/screen_event_task_switch_metric_recorder.h
diff --git a/ash/metrics/screen_event_task_switch_metric_recorder.h b/ash/metrics/screen_event_task_switch_metric_recorder.h
new file mode 100644
index 0000000000000000000000000000000000000000..fffebc66505bf2fbffb9584ec9d5b0ac3a2a1871
--- /dev/null
+++ b/ash/metrics/screen_event_task_switch_metric_recorder.h
@@ -0,0 +1,42 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_METRICS_SCREEN_EVENT_TASK_SWITCH_METRIC_RECORDER_H_
+#define ASH_METRICS_SCREEN_EVENT_TASK_SWITCH_METRIC_RECORDER_H_
+
+#include "ash/ash_export.h"
+#include "base/macros.h"
+#include "ui/wm/core/window_activation_pre_target_handler_observer.h"
+#include "ui/wm/public/activation_change_observer.h"
+
+namespace aura {
+class Window;
+} // namespace aura
+
+namespace ash {
+
+class UserMetricsRecorder;
+
+class ASH_EXPORT ScreenEventTaskSwitchMetricRecorder
+ : public wm::WindowActivationPreTargetHandlerObserver {
+ public:
+ explicit ScreenEventTaskSwitchMetricRecorder(
+ UserMetricsRecorder* user_metrics_recorder);
+ ~ScreenEventTaskSwitchMetricRecorder() override;
+
+ // wm::WindowActivationPreTargetHandlerObserver:
+ void BeforeWindowActivatedByPreTargetHandler() override;
+ void OnWindowActivatedByPreTargetHandler(aura::Window* gained_active,
+ aura::Window* lost_active) override;
+
+ private:
+ UserMetricsRecorder* user_metrics_recorder_;
+ aura::Window* active_window_before_activation_ = nullptr;
tdanderson 2015/05/26 21:13:52 initialize to null in constructor
bruthig 2015/06/03 21:59:31 Done.
+
+ DISALLOW_COPY_AND_ASSIGN(ScreenEventTaskSwitchMetricRecorder);
+};
+
+} // namespace ash
+
+#endif // ASH_METRICS_SCREEN_EVENT_TASK_SWITCH_METRIC_RECORDER_H_

Powered by Google App Engine
This is Rietveld 408576698