| 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/window_cycle_event_filter.h" | 10 #include "ash/common/wm/window_cycle_event_filter.h" |
| 10 #include "ash/common/wm_shell.h" | 11 #include "ash/common/wm_shell.h" |
| 11 #include "ash/shell.h" | 12 #include "ash/shell.h" |
| 12 #include "ash/wm/window_cycle_list.h" | 13 #include "ash/wm/window_cycle_list.h" |
| 13 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
| 14 | 15 |
| 15 namespace ash { | 16 namespace ash { |
| 16 | 17 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 WmWindow* active_window_after_window_cycle = GetActiveWindow( | 80 WmWindow* active_window_after_window_cycle = GetActiveWindow( |
| 80 WmShell::Get()->mru_window_tracker()->BuildMruWindowList()); | 81 WmShell::Get()->mru_window_tracker()->BuildMruWindowList()); |
| 81 | 82 |
| 82 // Remove our key event filter. | 83 // Remove our key event filter. |
| 83 event_filter_.reset(); | 84 event_filter_.reset(); |
| 84 UMA_HISTOGRAM_MEDIUM_TIMES("Ash.WindowCycleController.CycleTime", | 85 UMA_HISTOGRAM_MEDIUM_TIMES("Ash.WindowCycleController.CycleTime", |
| 85 base::Time::Now() - cycle_start_time_); | 86 base::Time::Now() - cycle_start_time_); |
| 86 | 87 |
| 87 if (active_window_after_window_cycle != nullptr && | 88 if (active_window_after_window_cycle != nullptr && |
| 88 active_window_before_window_cycle_ != active_window_after_window_cycle) { | 89 active_window_before_window_cycle_ != active_window_after_window_cycle) { |
| 89 Shell::GetInstance() | 90 WmShell::Get()->RecordTaskSwitchMetric( |
| 90 ->metrics() | 91 TaskSwitchSource::WINDOW_CYCLE_CONTROLLER); |
| 91 ->task_switch_metrics_recorder() | |
| 92 .OnTaskSwitch(TaskSwitchMetricsRecorder::WINDOW_CYCLE_CONTROLLER); | |
| 93 } | 92 } |
| 94 active_window_before_window_cycle_ = nullptr; | 93 active_window_before_window_cycle_ = nullptr; |
| 95 } | 94 } |
| 96 | 95 |
| 97 } // namespace ash | 96 } // namespace ash |
| OLD | NEW |