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

Side by Side Diff: ui/base/accelerators/accelerator_history.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 | « ui/base/accelerators/accelerator_history.h ('k') | ui/wm/core/accelerator_filter.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/base/accelerators/accelerator_history.h" 5 #include "ui/base/accelerators/accelerator_history.h"
6 6
7 namespace ui { 7 namespace ui {
8 8
9 AcceleratorHistory::AcceleratorHistory() {} 9 AcceleratorHistory::AcceleratorHistory() {}
10 10
(...skipping 13 matching lines...) Expand all
24 } else { 24 } else {
25 currently_pressed_keys_.erase(accelerator.key_code()); 25 currently_pressed_keys_.erase(accelerator.key_code());
26 } 26 }
27 27
28 if (accelerator != current_accelerator_) { 28 if (accelerator != current_accelerator_) {
29 previous_accelerator_ = current_accelerator_; 29 previous_accelerator_ = current_accelerator_;
30 current_accelerator_ = accelerator; 30 current_accelerator_ = accelerator;
31 } 31 }
32 } 32 }
33 33
34 void AcceleratorHistory::InterruptCurrentAccelerator() {
35 if (current_accelerator_.key_state() == Accelerator::KeyState::PRESSED) {
36 // Only interrupts pressed keys.
37 current_accelerator_.set_interrupted_by_mouse_event(true);
38 }
39 }
40
34 } // namespace ui 41 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/accelerators/accelerator_history.h ('k') | ui/wm/core/accelerator_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698