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

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

Issue 2923723002: Avoid toggling app list if interrupted by mouse (Closed)
Patch Set: Rebase and refactor is_interrupted_by_mouse_event() to interrupted_by_mouse_event() 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
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 } 371 }
372 372
373 bool CanHandleToggleAppList(const ui::Accelerator& accelerator, 373 bool CanHandleToggleAppList(const ui::Accelerator& accelerator,
374 const ui::Accelerator& previous_accelerator) { 374 const ui::Accelerator& previous_accelerator) {
375 if (accelerator.key_code() == ui::VKEY_LWIN) { 375 if (accelerator.key_code() == ui::VKEY_LWIN) {
376 // If something else was pressed between the Search key (LWIN) 376 // If something else was pressed between the Search key (LWIN)
377 // being pressed and released, then ignore the release of the 377 // being pressed and released, then ignore the release of the
378 // Search key. 378 // Search key.
379 if (previous_accelerator.key_state() != 379 if (previous_accelerator.key_state() !=
380 ui::Accelerator::KeyState::PRESSED || 380 ui::Accelerator::KeyState::PRESSED ||
381 previous_accelerator.key_code() != ui::VKEY_LWIN) { 381 previous_accelerator.key_code() != ui::VKEY_LWIN ||
382 previous_accelerator.interrupted_by_mouse_event()) {
382 return false; 383 return false;
383 } 384 }
384 385
385 // When spoken feedback is enabled, we should neither toggle the list nor 386 // When spoken feedback is enabled, we should neither toggle the list nor
386 // consume the key since Search+Shift is one of the shortcuts the a11y 387 // consume the key since Search+Shift is one of the shortcuts the a11y
387 // feature uses. crbug.com/132296 388 // feature uses. crbug.com/132296
388 if (Shell::Get()->accessibility_delegate()->IsSpokenFeedbackEnabled()) 389 if (Shell::Get()->accessibility_delegate()->IsSpokenFeedbackEnabled())
389 return false; 390 return false;
390 } 391 }
391 return true; 392 return true;
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
1317 data->uma_histogram_name, data->notification_message_id, 1318 data->uma_histogram_name, data->notification_message_id,
1318 data->old_shortcut_id, data->new_shortcut_id); 1319 data->old_shortcut_id, data->new_shortcut_id);
1319 1320
1320 if (!data->deprecated_enabled) 1321 if (!data->deprecated_enabled)
1321 return AcceleratorProcessingStatus::STOP; 1322 return AcceleratorProcessingStatus::STOP;
1322 1323
1323 return AcceleratorProcessingStatus::PROCEED; 1324 return AcceleratorProcessingStatus::PROCEED;
1324 } 1325 }
1325 1326
1326 } // namespace ash 1327 } // namespace ash
OLDNEW
« 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