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

Unified Diff: ash/common/wm/overview/window_grid.cc

Issue 2667293002: [ash-md] Adds support for gesture to move selection in overview mode (Closed)
Patch Set: [ash-md] Adds support for gesture to move selection in overview mode (tuning) Created 3 years, 10 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
Index: ash/common/wm/overview/window_grid.cc
diff --git a/ash/common/wm/overview/window_grid.cc b/ash/common/wm/overview/window_grid.cc
index 7cea80ba59af38a8f7f1a6fa0ed0e880a005b46d..e68ef074a019c3a0c8857f5480af9aa717361af6 100644
--- a/ash/common/wm/overview/window_grid.cc
+++ b/ash/common/wm/overview/window_grid.cc
@@ -282,7 +282,8 @@ WindowGrid::WindowGrid(WmWindow* root_window,
window_state_observer_(this),
selected_index_(0),
num_columns_(0),
- prepared_for_overview_(false) {
+ prepared_for_overview_(false),
+ skip_first_(false) {
std::vector<WmWindow*> windows_in_root;
for (auto* window : windows) {
if (window->GetRootWindow() == root_window)
@@ -488,9 +489,10 @@ bool WindowGrid::Move(WindowSelector::Direction direction, bool animate) {
break;
case WindowSelector::DOWN:
case WindowSelector::RIGHT:
- selected_index_ = 0;
+ selected_index_ = (skip_first_ && window_list_.size() > 1) ? 1 : 0;
break;
}
+ skip_first_ = false;
changed_selection_index = true;
}
while (!changed_selection_index ||

Powered by Google App Engine
This is Rietveld 408576698