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

Unified Diff: media/base/keyboard_event_counter.cc

Issue 2577573002: Removes mouse listeners from UserInputMonitor. (Closed)
Patch Set: Updates win's Start/Stop Monitor. Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
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,
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);
}
}

Powered by Google App Engine
This is Rietveld 408576698