| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/wm/window_cycle_controller.h" | 5 #include "ash/wm/window_cycle_controller.h" |
| 6 | 6 |
| 7 #include "ash/common/metrics/task_switch_source.h" |
| 7 #include "ash/common/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.h" |
| 8 #include "ash/common/wm/mru_window_tracker.h" | 9 #include "ash/common/wm/mru_window_tracker.h" |
| 9 #include "ash/common/wm_shell.h" | 10 #include "ash/common/wm_shell.h" |
| 10 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 11 #include "ash/wm/window_cycle_list.h" | 12 #include "ash/wm/window_cycle_list.h" |
| 12 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 13 #include "ui/events/event.h" | 14 #include "ui/events/event.h" |
| 14 #include "ui/events/event_handler.h" | 15 #include "ui/events/event_handler.h" |
| 15 | 16 |
| 16 namespace ash { | 17 namespace ash { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 WmWindow* active_window_after_window_cycle = GetActiveWindow( | 115 WmWindow* active_window_after_window_cycle = GetActiveWindow( |
| 115 WmShell::Get()->mru_window_tracker()->BuildMruWindowList()); | 116 WmShell::Get()->mru_window_tracker()->BuildMruWindowList()); |
| 116 | 117 |
| 117 // Remove our key event filter. | 118 // Remove our key event filter. |
| 118 event_handler_.reset(); | 119 event_handler_.reset(); |
| 119 UMA_HISTOGRAM_MEDIUM_TIMES("Ash.WindowCycleController.CycleTime", | 120 UMA_HISTOGRAM_MEDIUM_TIMES("Ash.WindowCycleController.CycleTime", |
| 120 base::Time::Now() - cycle_start_time_); | 121 base::Time::Now() - cycle_start_time_); |
| 121 | 122 |
| 122 if (active_window_after_window_cycle != nullptr && | 123 if (active_window_after_window_cycle != nullptr && |
| 123 active_window_before_window_cycle_ != active_window_after_window_cycle) { | 124 active_window_before_window_cycle_ != active_window_after_window_cycle) { |
| 124 Shell::GetInstance() | 125 WmShell::Get()->RecordTaskSwitchMetric( |
| 125 ->metrics() | 126 TaskSwitchSource::WINDOW_CYCLE_CONTROLLER); |
| 126 ->task_switch_metrics_recorder() | |
| 127 .OnTaskSwitch(TaskSwitchMetricsRecorder::WINDOW_CYCLE_CONTROLLER); | |
| 128 } | 127 } |
| 129 active_window_before_window_cycle_ = nullptr; | 128 active_window_before_window_cycle_ = nullptr; |
| 130 } | 129 } |
| 131 | 130 |
| 132 } // namespace ash | 131 } // namespace ash |
| OLD | NEW |