Roll src/third_party/WebKit dacf847:1e9d21c (svn 202600:202602)
[chromium-blink-merge.git] / ash / metrics / desktop_task_switch_metric_recorder.h
blob67bbb00380e74af089a10c111e0f0c92f9f20c4a
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"
12 namespace ash {
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 {
20 public:
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;
30 private:
31 // Tracks the last active task window.
32 aura::Window* last_active_task_window_;
34 DISALLOW_COPY_AND_ASSIGN(DesktopTaskSwitchMetricRecorder);
37 } // namespace ash
39 #endif // ASH_METRICS_DESKTOP_TASK_SWITCH_METRIC_RECORDER_H_