| Index: media/base/user_input_monitor.cc
|
| diff --git a/media/base/user_input_monitor.cc b/media/base/user_input_monitor.cc
|
| index 18b4c8060f64e34437d4e3e9222fde4d18af520a..b1005538e309d4b3a335078eb3b14c58c9c812fc 100644
|
| --- a/media/base/user_input_monitor.cc
|
| +++ b/media/base/user_input_monitor.cc
|
| @@ -71,13 +71,25 @@ void UserInputMonitor::OnKeyboardEvent(ui::EventType event,
|
| ui::KeyboardCode key_code) {
|
| base::AutoLock auto_lock(lock_);
|
| // Updates the pressed keys and maybe notifies the key_stroke_listeners_.
|
| + // The Mac implementation does not listen to the the key down/up events, but
|
| + // polls the key state and only notifies UserInputMonitor when a key is down
|
| + // now but not in the previous polling. So we do not check/update
|
| + // |pressed_keys_| here.
|
| if (event == ui::ET_KEY_PRESSED) {
|
| +#if !defined(OS_MACOSX)
|
| if (pressed_keys_.find(key_code) != pressed_keys_.end())
|
| return;
|
| pressed_keys_.insert(key_code);
|
| +#endif
|
| +
|
| DVLOG(6) << "Key stroke detected.";
|
| FOR_EACH_OBSERVER(KeyStrokeListener, key_stroke_listeners_, OnKeyStroke());
|
| } else {
|
| +#if defined(OS_MACOSX)
|
| + NOTREACHED();
|
| + return;
|
| +#endif
|
| +
|
| DCHECK_EQ(ui::ET_KEY_RELEASED, event);
|
| DCHECK(pressed_keys_.find(key_code) != pressed_keys_.end());
|
| pressed_keys_.erase(key_code);
|
|
|