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.
5 #ifndef ASH_METRICS_DESKTOP_TASK_SWITCH_METRIC_RECORDER_H_
6 #define ASH_METRICS_DESKTOP_TASK_SWITCH_METRIC_RECORDER_H_
8 #include "ash/ash_export.h"
9 #include "base/macros.h"
10 #include "ui/wm/public/activation_change_observer.h"
14 class UserMetricsRecorder
;
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
{
21 explicit DesktopTaskSwitchMetricRecorder();
22 ~DesktopTaskSwitchMetricRecorder() override
;
24 // aura::client::ActivationChangeObserver:
25 void OnWindowActivated(
26 aura::client::ActivationChangeObserver::ActivationReason reason
,
27 aura::Window
* gained_active
,
28 aura::Window
* lost_active
) override
;
31 // Tracks the last active task window.
32 aura::Window
* last_active_task_window_
;
34 DISALLOW_COPY_AND_ASSIGN(DesktopTaskSwitchMetricRecorder
);
39 #endif // ASH_METRICS_DESKTOP_TASK_SWITCH_METRIC_RECORDER_H_