| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/shell_delegate.h" | 9 #include "ash/session_state_delegate.h" |
| 10 #include "ash/shell.h" |
| 10 #include "ash/shell_window_ids.h" | 11 #include "ash/shell_window_ids.h" |
| 11 #include "ash/wm/activation_controller.h" | 12 #include "ash/wm/activation_controller.h" |
| 12 #include "ash/wm/window_cycle_list.h" | 13 #include "ash/wm/window_cycle_list.h" |
| 13 #include "ash/wm/window_util.h" | 14 #include "ash/wm/window_util.h" |
| 14 #include "ash/wm/workspace_controller.h" | 15 #include "ash/wm/workspace_controller.h" |
| 15 #include "ui/aura/root_window.h" | 16 #include "ui/aura/root_window.h" |
| 16 #include "ui/base/events/event.h" | 17 #include "ui/base/events/event.h" |
| 17 #include "ui/base/events/event_handler.h" | 18 #include "ui/base/events/event_handler.h" |
| 18 | 19 |
| 19 namespace ash { | 20 namespace ash { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 } | 115 } |
| 115 | 116 |
| 116 activation_client_->RemoveObserver(this); | 117 activation_client_->RemoveObserver(this); |
| 117 StopCycling(); | 118 StopCycling(); |
| 118 } | 119 } |
| 119 | 120 |
| 120 // static | 121 // static |
| 121 bool WindowCycleController::CanCycle() { | 122 bool WindowCycleController::CanCycle() { |
| 122 // Don't allow window cycling if the screen is locked or a modal dialog is | 123 // Don't allow window cycling if the screen is locked or a modal dialog is |
| 123 // open. | 124 // open. |
| 124 return !Shell::GetInstance()->IsScreenLocked() && | 125 return !Shell::GetInstance()->session_state_delegate()->IsScreenLocked() && |
| 125 !Shell::GetInstance()->IsSystemModalWindowOpen(); | 126 !Shell::GetInstance()->IsSystemModalWindowOpen(); |
| 126 } | 127 } |
| 127 | 128 |
| 128 void WindowCycleController::HandleCycleWindow(Direction direction, | 129 void WindowCycleController::HandleCycleWindow(Direction direction, |
| 129 bool is_alt_down) { | 130 bool is_alt_down) { |
| 130 if (!CanCycle()) | 131 if (!CanCycle()) |
| 131 return; | 132 return; |
| 132 | 133 |
| 133 if (is_alt_down) { | 134 if (is_alt_down) { |
| 134 if (!IsCycling()) { | 135 if (!IsCycling()) { |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 mru_windows_.remove(window); | 296 mru_windows_.remove(window); |
| 296 if (window->id() == internal::kShellWindowId_WorkspaceContainer) | 297 if (window->id() == internal::kShellWindowId_WorkspaceContainer) |
| 297 window->RemoveObserver(this); | 298 window->RemoveObserver(this); |
| 298 } | 299 } |
| 299 | 300 |
| 300 void WindowCycleController::OnWindowDestroying(aura::Window* window) { | 301 void WindowCycleController::OnWindowDestroying(aura::Window* window) { |
| 301 window->RemoveObserver(this); | 302 window->RemoveObserver(this); |
| 302 } | 303 } |
| 303 | 304 |
| 304 } // namespace ash | 305 } // namespace ash |
| OLD | NEW |