| 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/session/session_state_delegate.h" | 7 #include "ash/common/session/session_state_delegate.h" | 
| 8 #include "ash/common/wm/mru_window_tracker.h" | 8 #include "ash/common/wm/mru_window_tracker.h" | 
| 9 #include "ash/common/wm_shell.h" | 9 #include "ash/common/wm_shell.h" | 
| 10 #include "ash/metrics/user_metrics_recorder.h" | 10 #include "ash/metrics/user_metrics_recorder.h" | 
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 67 } | 67 } | 
| 68 | 68 | 
| 69 WindowCycleController::~WindowCycleController() { | 69 WindowCycleController::~WindowCycleController() { | 
| 70 } | 70 } | 
| 71 | 71 | 
| 72 // static | 72 // static | 
| 73 bool WindowCycleController::CanCycle() { | 73 bool WindowCycleController::CanCycle() { | 
| 74   // Don't allow window cycling if the screen is locked or a modal dialog is | 74   // Don't allow window cycling if the screen is locked or a modal dialog is | 
| 75   // open. | 75   // open. | 
| 76   return !Shell::GetInstance()->session_state_delegate()->IsScreenLocked() && | 76   return !Shell::GetInstance()->session_state_delegate()->IsScreenLocked() && | 
| 77          !WmShell::Get()->IsSystemModalWindowOpen(); | 77          !WmShell::Get()->IsSystemModalWindowOpen() && | 
|  | 78          !WmShell::Get()->IsPinned(); | 
| 78 } | 79 } | 
| 79 | 80 | 
| 80 void WindowCycleController::HandleCycleWindow(Direction direction) { | 81 void WindowCycleController::HandleCycleWindow(Direction direction) { | 
| 81   if (!CanCycle()) | 82   if (!CanCycle()) | 
| 82     return; | 83     return; | 
| 83 | 84 | 
| 84   if (!IsCycling()) | 85   if (!IsCycling()) | 
| 85     StartCycling(); | 86     StartCycling(); | 
| 86 | 87 | 
| 87   Step(direction); | 88   Step(direction); | 
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 122       active_window_before_window_cycle_ != active_window_after_window_cycle) { | 123       active_window_before_window_cycle_ != active_window_after_window_cycle) { | 
| 123     Shell::GetInstance() | 124     Shell::GetInstance() | 
| 124         ->metrics() | 125         ->metrics() | 
| 125         ->task_switch_metrics_recorder() | 126         ->task_switch_metrics_recorder() | 
| 126         .OnTaskSwitch(TaskSwitchMetricsRecorder::WINDOW_CYCLE_CONTROLLER); | 127         .OnTaskSwitch(TaskSwitchMetricsRecorder::WINDOW_CYCLE_CONTROLLER); | 
| 127   } | 128   } | 
| 128   active_window_before_window_cycle_ = nullptr; | 129   active_window_before_window_cycle_ = nullptr; | 
| 129 } | 130 } | 
| 130 | 131 | 
| 131 }  // namespace ash | 132 }  // namespace ash | 
| OLD | NEW | 
|---|