OLD | NEW |
| (Empty) |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef ASH_METRICS_DESKTOP_TASK_SWITCH_METRIC_RECORDER_H_ | |
6 #define ASH_METRICS_DESKTOP_TASK_SWITCH_METRIC_RECORDER_H_ | |
7 | |
8 #include "ash/ash_export.h" | |
9 #include "base/macros.h" | |
10 #include "ui/wm/public/activation_change_observer.h" | |
11 | |
12 namespace ash { | |
13 | |
14 class UserMetricsRecorder; | |
15 | |
16 // Tracks metrics for task switches caused by the user activating a task window | |
17 // by clicking or tapping on it. | |
18 class ASH_EXPORT DesktopTaskSwitchMetricRecorder | |
19 : public aura::client::ActivationChangeObserver { | |
20 public: | |
21 explicit DesktopTaskSwitchMetricRecorder(); | |
22 ~DesktopTaskSwitchMetricRecorder() override; | |
23 | |
24 // aura::client::ActivationChangeObserver: | |
25 void OnWindowActivated( | |
26 aura::client::ActivationChangeObserver::ActivationReason reason, | |
27 aura::Window* gained_active, | |
28 aura::Window* lost_active) override; | |
29 | |
30 private: | |
31 // Tracks the last active task window. | |
32 aura::Window* last_active_task_window_; | |
33 | |
34 DISALLOW_COPY_AND_ASSIGN(DesktopTaskSwitchMetricRecorder); | |
35 }; | |
36 | |
37 } // namespace ash | |
38 | |
39 #endif // ASH_METRICS_DESKTOP_TASK_SWITCH_METRIC_RECORDER_H_ | |
OLD | NEW |