Index: ash/wm/window_cycle_controller.cc |
diff --git a/ash/wm/window_cycle_controller.cc b/ash/wm/window_cycle_controller.cc |
index 2aae2a67641641840d468baa7ea7281f68104782..419608f97892f821f0b6042d539bb30ffa9d6401 100644 |
--- a/ash/wm/window_cycle_controller.cc |
+++ b/ash/wm/window_cycle_controller.cc |
@@ -149,13 +149,25 @@ void WindowCycleController::HandleCycleWindow(Direction direction, |
} |
} |
+void WindowCycleController::HandleLinearCycleWindow() { |
+ if (!CanCycle() || IsCycling()) |
+ return; |
+ |
+ // Use the reversed list of windows to prevent a 2-cycle of the most recent |
+ // windows occurring. |
+ windows_.reset(new WindowCycleList(BuildWindowList(NULL, true))); |
James Cook
2013/03/22 16:45:36
I would just make the WindowCycleList a local vari
|
+ Step(FORWARD); |
+ windows_.reset(); |
+} |
+ |
void WindowCycleController::AltKeyReleased() { |
StopCycling(); |
} |
// static |
std::vector<aura::Window*> WindowCycleController::BuildWindowList( |
- const std::list<aura::Window*>* mru_windows) { |
+ const std::list<aura::Window*>* mru_windows, |
+ bool reverse_order) { |
James Cook
2013/03/22 16:45:36
I would either change the sense of this boolean to
|
WindowCycleList::WindowList windows; |
Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
@@ -198,7 +210,8 @@ std::vector<aura::Window*> WindowCycleController::BuildWindowList( |
} |
// Window cycling expects the topmost window at the front of the list. |
- std::reverse(windows.begin(), windows.end()); |
+ if (!reverse_order) |
+ std::reverse(windows.begin(), windows.end()); |
return windows; |
} |
@@ -225,7 +238,7 @@ void WindowCycleController::OnRootWindowAdded(aura::RootWindow* root_window) { |
// WindowCycleController, private: |
void WindowCycleController::StartCycling() { |
- windows_.reset(new WindowCycleList(BuildWindowList(&mru_windows_))); |
+ windows_.reset(new WindowCycleList(BuildWindowList(&mru_windows_, false))); |
} |
void WindowCycleController::Step(Direction direction) { |