Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Side by Side Diff: trunk/src/ash/wm/window_cycle_controller.cc

Issue 14200034: Revert 194578 "Add ash SessionStateDelegate" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/session_state_delegate.h" 9 #include "ash/shell_delegate.h"
10 #include "ash/shell.h"
11 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
12 #include "ash/wm/activation_controller.h" 11 #include "ash/wm/activation_controller.h"
13 #include "ash/wm/window_cycle_list.h" 12 #include "ash/wm/window_cycle_list.h"
14 #include "ash/wm/window_util.h" 13 #include "ash/wm/window_util.h"
15 #include "ash/wm/workspace_controller.h" 14 #include "ash/wm/workspace_controller.h"
16 #include "ui/aura/root_window.h" 15 #include "ui/aura/root_window.h"
17 #include "ui/base/events/event.h" 16 #include "ui/base/events/event.h"
18 #include "ui/base/events/event_handler.h" 17 #include "ui/base/events/event_handler.h"
19 18
20 namespace ash { 19 namespace ash {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 } 114 }
116 115
117 activation_client_->RemoveObserver(this); 116 activation_client_->RemoveObserver(this);
118 StopCycling(); 117 StopCycling();
119 } 118 }
120 119
121 // static 120 // static
122 bool WindowCycleController::CanCycle() { 121 bool WindowCycleController::CanCycle() {
123 // Don't allow window cycling if the screen is locked or a modal dialog is 122 // Don't allow window cycling if the screen is locked or a modal dialog is
124 // open. 123 // open.
125 return !Shell::GetInstance()->session_state_delegate()->IsScreenLocked() && 124 return !Shell::GetInstance()->IsScreenLocked() &&
126 !Shell::GetInstance()->IsSystemModalWindowOpen(); 125 !Shell::GetInstance()->IsSystemModalWindowOpen();
127 } 126 }
128 127
129 void WindowCycleController::HandleCycleWindow(Direction direction, 128 void WindowCycleController::HandleCycleWindow(Direction direction,
130 bool is_alt_down) { 129 bool is_alt_down) {
131 if (!CanCycle()) 130 if (!CanCycle())
132 return; 131 return;
133 132
134 if (is_alt_down) { 133 if (is_alt_down) {
135 if (!IsCycling()) { 134 if (!IsCycling()) {
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 mru_windows_.remove(window); 295 mru_windows_.remove(window);
297 if (window->id() == internal::kShellWindowId_WorkspaceContainer) 296 if (window->id() == internal::kShellWindowId_WorkspaceContainer)
298 window->RemoveObserver(this); 297 window->RemoveObserver(this);
299 } 298 }
300 299
301 void WindowCycleController::OnWindowDestroying(aura::Window* window) { 300 void WindowCycleController::OnWindowDestroying(aura::Window* window) {
302 window->RemoveObserver(this); 301 window->RemoveObserver(this);
303 } 302 }
304 303
305 } // namespace ash 304 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698