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

Side by Side Diff: ash/accelerators/accelerator_controller.cc

Issue 2923723002: Avoid toggling app list if interrupted by mouse (Closed)
Patch Set: Add unit test in accelerator_filter_unittest.cc Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/accelerators/accelerator_controller.h" 5 #include "ash/accelerators/accelerator_controller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/accelerators/accelerator_commands.h" 9 #include "ash/accelerators/accelerator_commands.h"
10 #include "ash/accelerators/accelerator_controller_delegate.h" 10 #include "ash/accelerators/accelerator_controller_delegate.h"
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 } 386 }
387 387
388 bool CanHandleToggleAppList(const ui::Accelerator& accelerator, 388 bool CanHandleToggleAppList(const ui::Accelerator& accelerator,
389 const ui::Accelerator& previous_accelerator) { 389 const ui::Accelerator& previous_accelerator) {
390 if (accelerator.key_code() == ui::VKEY_LWIN) { 390 if (accelerator.key_code() == ui::VKEY_LWIN) {
391 // If something else was pressed between the Search key (LWIN) 391 // If something else was pressed between the Search key (LWIN)
392 // being pressed and released, then ignore the release of the 392 // being pressed and released, then ignore the release of the
393 // Search key. 393 // Search key.
394 if (previous_accelerator.key_state() != 394 if (previous_accelerator.key_state() !=
395 ui::Accelerator::KeyState::PRESSED || 395 ui::Accelerator::KeyState::PRESSED ||
396 previous_accelerator.key_code() != ui::VKEY_LWIN) { 396 previous_accelerator.key_code() != ui::VKEY_LWIN ||
397 previous_accelerator.is_interrupted_by_mouse_event()) {
397 return false; 398 return false;
398 } 399 }
399 400
400 // When spoken feedback is enabled, we should neither toggle the list nor 401 // When spoken feedback is enabled, we should neither toggle the list nor
401 // consume the key since Search+Shift is one of the shortcuts the a11y 402 // consume the key since Search+Shift is one of the shortcuts the a11y
402 // feature uses. crbug.com/132296 403 // feature uses. crbug.com/132296
403 if (Shell::Get()->accessibility_delegate()->IsSpokenFeedbackEnabled()) 404 if (Shell::Get()->accessibility_delegate()->IsSpokenFeedbackEnabled())
404 return false; 405 return false;
405 } 406 }
406 return true; 407 return true;
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 data->uma_histogram_name, data->notification_message_id, 1333 data->uma_histogram_name, data->notification_message_id,
1333 data->old_shortcut_id, data->new_shortcut_id); 1334 data->old_shortcut_id, data->new_shortcut_id);
1334 1335
1335 if (!data->deprecated_enabled) 1336 if (!data->deprecated_enabled)
1336 return AcceleratorProcessingStatus::STOP; 1337 return AcceleratorProcessingStatus::STOP;
1337 1338
1338 return AcceleratorProcessingStatus::PROCEED; 1339 return AcceleratorProcessingStatus::PROCEED;
1339 } 1340 }
1340 1341
1341 } // namespace ash 1342 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller_unittest.cc » ('j') | ui/base/accelerators/accelerator.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698