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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 11578044: Enable Search-key modifiers for extended key shortcuts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years 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/accelerators/accelerator_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_controller.cc
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index fbe39d16a2bef57acd9b520adb457ee134d8c662..7e51fd80dd09239faf5cf5db914e955421f39fb3 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -537,26 +537,13 @@ bool AcceleratorController::PerformAction(int action,
// this key combination is reserved for partial screenshot.
return true;
case TOGGLE_APP_LIST:
- if (accelerator.key_code() == ui::VKEY_LWIN) {
- // For bindings on the Search key, activate the binding on press if the
- // Search key is not acting as a modifier. Otherwise, activate it on
- // release.
- const bool search_as_function_key =
- Shell::GetInstance()->delegate()->IsSearchKeyActingAsFunctionKey();
- const bool type_pressed = accelerator.type() == ui::ET_KEY_PRESSED;
-
- if (!search_as_function_key && !type_pressed)
+ if (key_code == ui::VKEY_LWIN) {
+ // If something else was pressed between the Search key (LWIN)
+ // being pressed and released, then ignore the release of the
+ // Search key.
+ if (previous_event_type == ui::ET_KEY_RELEASED ||
sky 2012/12/17 22:29:00 nit: combine ifs.
danakj 2012/12/17 22:32:13 Done.
+ previous_key_code != ui::VKEY_LWIN)
return false;
- if (search_as_function_key && type_pressed)
- return false;
- if (search_as_function_key &&
- // If something else was pressed between the Search key (LWIN)
- // being pressed and released, then ignore the release of the
- // Search key.
- (previous_event_type == ui::ET_KEY_RELEASED ||
- previous_key_code != ui::VKEY_LWIN)) {
- return false;
- }
}
if (key_code == ui::VKEY_LWIN)
shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_SEARCH_LWIN);
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698