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

Unified Diff: ash/wm/window_cycle_controller.cc

Issue 12618014: Switch Next Window Key functionality (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: gesture change Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/window_cycle_controller.h ('k') | chrome/browser/chromeos/extensions/wallpaper_private_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..86f3cf8ca643f5961097385f217620c2d2654c43 100644
--- a/ash/wm/window_cycle_controller.cc
+++ b/ash/wm/window_cycle_controller.cc
@@ -149,13 +149,24 @@ 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.
+ WindowCycleList cycle_list(BuildWindowList(NULL,true));
+ cycle_list.Step(WindowCycleList::FORWARD);
+}
+
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 top_most_at_end) {
WindowCycleList::WindowList windows;
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
@@ -198,7 +209,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 (!top_most_at_end)
+ std::reverse(windows.begin(), windows.end());
return windows;
}
@@ -225,7 +237,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) {
« no previous file with comments | « ash/wm/window_cycle_controller.h ('k') | chrome/browser/chromeos/extensions/wallpaper_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698