| 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/common/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/metrics/task_switch_source.h" |
| 8 #include "ash/common/session/session_state_delegate.h" | |
| 9 #include "ash/common/wm/mru_window_tracker.h" | |
| 10 #include "ash/common/wm/window_cycle_event_filter.h" | |
| 11 #include "ash/common/wm/window_cycle_list.h" | |
| 12 #include "ash/common/wm/window_state.h" | |
| 13 #include "ash/common/wm_shell.h" | |
| 14 #include "ash/common/wm_window.h" | |
| 15 #include "ash/public/cpp/shell_window_ids.h" | 8 #include "ash/public/cpp/shell_window_ids.h" |
| 9 #include "ash/session/session_state_delegate.h" |
| 10 #include "ash/wm/mru_window_tracker.h" |
| 11 #include "ash/wm/window_cycle_event_filter.h" |
| 12 #include "ash/wm/window_cycle_list.h" |
| 13 #include "ash/wm/window_state.h" |
| 14 #include "ash/wm_shell.h" |
| 15 #include "ash/wm_window.h" |
| 16 #include "base/metrics/histogram_macros.h" | 16 #include "base/metrics/histogram_macros.h" |
| 17 | 17 |
| 18 namespace ash { | 18 namespace ash { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 // Returns the most recently active window from the |window_list| or nullptr | 22 // Returns the most recently active window from the |window_list| or nullptr |
| 23 // if the list is empty. | 23 // if the list is empty. |
| 24 WmWindow* GetActiveWindow(const MruWindowTracker::WindowList& window_list) { | 24 WmWindow* GetActiveWindow(const MruWindowTracker::WindowList& window_list) { |
| 25 return window_list.empty() ? nullptr : window_list[0]; | 25 return window_list.empty() ? nullptr : window_list[0]; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 if (active_window_after_window_cycle != nullptr && | 118 if (active_window_after_window_cycle != nullptr && |
| 119 active_window_before_window_cycle_ != active_window_after_window_cycle) { | 119 active_window_before_window_cycle_ != active_window_after_window_cycle) { |
| 120 WmShell::Get()->RecordTaskSwitchMetric( | 120 WmShell::Get()->RecordTaskSwitchMetric( |
| 121 TaskSwitchSource::WINDOW_CYCLE_CONTROLLER); | 121 TaskSwitchSource::WINDOW_CYCLE_CONTROLLER); |
| 122 } | 122 } |
| 123 active_window_before_window_cycle_ = nullptr; | 123 active_window_before_window_cycle_ = nullptr; |
| 124 } | 124 } |
| 125 | 125 |
| 126 } // namespace ash | 126 } // namespace ash |
| OLD | NEW |