OLD | NEW |
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 Loading... |
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 |
OLD | NEW |