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

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: [ash-md] Makes Ctrl+W accelerator close a selected window in overview mode (rebase) 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 03ed6fd9fb1a88084e5324c521498c672bde9757..43f98d7053654a94bd1527c09870581cc2ffd04a 100644
--- a/ash/common/wm/overview/window_selector.cc
+++ b/ash/common/wm/overview/window_selector.cc
@@ -499,13 +499,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)) {
tdanderson 2016/07/07 21:26:49 nit: I think this is slightly more readable: if (k
varkha 2016/07/08 00:00:13 Done.
+ 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.
+ return false;
+ }
+ grid_list_[selected_grid_index_]->SelectedWindow()->CloseWindow();
+ 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