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/shell_delegate.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 | 242 |
243 void WindowCycleController::Step(Direction direction) { | 243 void WindowCycleController::Step(Direction direction) { |
244 DCHECK(windows_.get()); | 244 DCHECK(windows_.get()); |
245 windows_->Step(direction == FORWARD ? WindowCycleList::FORWARD : | 245 windows_->Step(direction == FORWARD ? WindowCycleList::FORWARD : |
246 WindowCycleList::BACKWARD); | 246 WindowCycleList::BACKWARD); |
247 } | 247 } |
248 | 248 |
249 void WindowCycleController::StopCycling() { | 249 void WindowCycleController::StopCycling() { |
250 windows_.reset(); | 250 windows_.reset(); |
251 // Remove our key event filter. | 251 // Remove our key event filter. |
252 if (event_handler_.get()) { | 252 if (event_handler_) { |
253 Shell::GetInstance()->RemovePreTargetHandler(event_handler_.get()); | 253 Shell::GetInstance()->RemovePreTargetHandler(event_handler_.get()); |
254 event_handler_.reset(); | 254 event_handler_.reset(); |
255 } | 255 } |
256 | 256 |
257 // Add the currently focused window to the MRU list | 257 // Add the currently focused window to the MRU list |
258 aura::Window* active_window = wm::GetActiveWindow(); | 258 aura::Window* active_window = wm::GetActiveWindow(); |
259 mru_windows_.remove(active_window); | 259 mru_windows_.remove(active_window); |
260 mru_windows_.push_front(active_window); | 260 mru_windows_.push_front(active_window); |
261 } | 261 } |
262 | 262 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 mru_windows_.remove(window); | 295 mru_windows_.remove(window); |
296 if (window->id() == internal::kShellWindowId_WorkspaceContainer) | 296 if (window->id() == internal::kShellWindowId_WorkspaceContainer) |
297 window->RemoveObserver(this); | 297 window->RemoveObserver(this); |
298 } | 298 } |
299 | 299 |
300 void WindowCycleController::OnWindowDestroying(aura::Window* window) { | 300 void WindowCycleController::OnWindowDestroying(aura::Window* window) { |
301 window->RemoveObserver(this); | 301 window->RemoveObserver(this); |
302 } | 302 } |
303 | 303 |
304 } // namespace ash | 304 } // namespace ash |
OLD | NEW |