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

Side by Side Diff: ash/wm/overview/window_selector.cc

Issue 324493004: Fix pressing enter key crashes overview mode without a selection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added unittest Created 6 years, 6 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/overview/window_selector.h" 5 #include "ash/wm/overview/window_selector.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/accessibility_delegate.h" 9 #include "ash/accessibility_delegate.h"
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 case ui::VKEY_DOWN: 211 case ui::VKEY_DOWN:
212 Move(WindowSelector::DOWN); 212 Move(WindowSelector::DOWN);
213 break; 213 break;
214 case ui::VKEY_RIGHT: 214 case ui::VKEY_RIGHT:
215 Move(WindowSelector::RIGHT); 215 Move(WindowSelector::RIGHT);
216 break; 216 break;
217 case ui::VKEY_LEFT: 217 case ui::VKEY_LEFT:
218 Move(WindowSelector::LEFT); 218 Move(WindowSelector::LEFT);
219 break; 219 break;
220 case ui::VKEY_RETURN: 220 case ui::VKEY_RETURN:
221 wm::GetWindowState( 221 if (grid_list_[selected_grid_index_]->is_selecting()) {
tdanderson 2014/06/06 21:15:17 A short comment would be nice to say something lik
Nina 2014/06/06 21:44:32 Done.
222 grid_list_[selected_grid_index_]-> 222 wm::GetWindowState(grid_list_[selected_grid_index_]->
223 SelectedWindow()->SelectionWindow())->Activate(); 223 SelectedWindow()->SelectionWindow())->Activate();
224 }
tdanderson 2014/06/06 21:15:17 I think you will want to set handled = false; in t
Nina 2014/06/06 21:44:32 Done.
224 break; 225 break;
225 default: 226 default:
226 // Not a key we are interested in. 227 // Not a key we are interested in.
227 handled = false; 228 handled = false;
228 break; 229 break;
229 } 230 }
230 if (handled) 231 if (handled)
231 event->SetHandled(); 232 event->SetHandled();
232 } 233 }
233 234
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 // root window, identify it and call Move() on it to initialize the 366 // root window, identify it and call Move() on it to initialize the
366 // selection widget. 367 // selection widget.
367 // TODO(nsatragno): If there are more than two monitors, move between grids 368 // TODO(nsatragno): If there are more than two monitors, move between grids
368 // in the requested direction. 369 // in the requested direction.
369 selected_grid_index_ = (selected_grid_index_ + 1) % grid_list_.size(); 370 selected_grid_index_ = (selected_grid_index_ + 1) % grid_list_.size();
370 grid_list_[selected_grid_index_]->Move(direction); 371 grid_list_[selected_grid_index_]->Move(direction);
371 } 372 }
372 } 373 }
373 374
374 } // namespace ash 375 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/wm/overview/window_selector_unittest.cc » ('j') | ash/wm/overview/window_selector_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698