Chromium Code Reviews| Index: media/base/keyboard_event_counter.cc |
| diff --git a/media/base/keyboard_event_counter.cc b/media/base/keyboard_event_counter.cc |
| index 8432aec37e38171d0dd1ef24057d91a6af8d0dfd..7c761c16d01242a9dc632ed28a95caf4b1e294e0 100644 |
| --- a/media/base/keyboard_event_counter.cc |
| +++ b/media/base/keyboard_event_counter.cc |
| @@ -19,17 +19,16 @@ void KeyboardEventCounter::Reset() { |
| reinterpret_cast<base::subtle::AtomicWord*>(&total_key_presses_), 0); |
| } |
| -void KeyboardEventCounter::OnKeyboardEvent(ui::EventType event, |
| +void KeyboardEventCounter::OnKeyboardEvent(bool down, |
|
xhwang
2017/01/10 20:13:15
personally I found an explicit enum is more readab
Wez
2017/01/10 23:19:24
Yes, strictly it's preferable to keep this as an e
CJ
2017/01/11 21:40:27
Confused as how the key_is_down ? KeyDown : KeyUp
Wez
2017/01/11 21:54:22
I just meant that instead of restoring this:
CJ
2017/01/11 23:08:09
Done.
|
| ui::KeyboardCode key_code) { |
| // Updates the pressed keys and the total count of key presses. |
| - if (event == ui::ET_KEY_PRESSED) { |
| + if (down) { |
| if (pressed_keys_.find(key_code) != pressed_keys_.end()) |
| return; |
| pressed_keys_.insert(key_code); |
| base::subtle::NoBarrier_AtomicIncrement( |
| reinterpret_cast<base::subtle::AtomicWord*>(&total_key_presses_), 1); |
| } else { |
| - DCHECK_EQ(ui::ET_KEY_RELEASED, event); |
| pressed_keys_.erase(key_code); |
| } |
| } |