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

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

Issue 2131603004: [ash-md] Makes Ctrl+W accelerator close a selected window in overview mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | ash/common/wm/overview/window_selector_item.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/overview/window_selector.cc
diff --git a/ash/common/wm/overview/window_selector.cc b/ash/common/wm/overview/window_selector.cc
index 55bcb1a02bd67a725014ae09ef11d2fe424a3cb0..3a7cebda26489a3f4046339dd84d0b3c7eb5ea76 100644
--- a/ash/common/wm/overview/window_selector.cc
+++ b/ash/common/wm/overview/window_selector.cc
@@ -495,13 +495,24 @@ bool WindowSelector::HandleKeyEvent(views::Textfield* sender,
break;
case ui::VKEY_RIGHT:
case ui::VKEY_TAB:
- num_key_presses_++;
- Move(WindowSelector::RIGHT, true);
- break;
+ if (!(key_event.flags() & ui::EF_SHIFT_DOWN) ||
+ (key_event.key_code() != ui::VKEY_TAB)) {
+ num_key_presses_++;
+ Move(WindowSelector::RIGHT, true);
+ break;
+ }
case ui::VKEY_LEFT:
num_key_presses_++;
Move(WindowSelector::LEFT, true);
break;
+ case ui::VKEY_W:
+ if (!(key_event.flags() & ui::EF_CONTROL_DOWN) ||
+ !grid_list_[selected_grid_index_]->is_selecting()) {
+ // allow the textfield to handle 'W' key when not used with Ctrl.
tdanderson 2016/07/07 21:26:49 nit: 'Allow' instead of 'allow'
varkha 2016/07/08 00:00:12 Done.
+ return false;
+ }
+ grid_list_[selected_grid_index_]->SelectedWindow()->CloseWindow();
tdanderson 2016/07/07 21:26:49 Either here or in a follow-up CL, consider adding
varkha 2016/07/08 00:00:12 Done.
+ break;
case ui::VKEY_RETURN:
// Ignore if no item is selected.
if (!grid_list_[selected_grid_index_]->is_selecting())
« no previous file with comments | « no previous file | ash/common/wm/overview/window_selector_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698