Chromium Code Reviews| Index: remoting/protocol/input_event_tracker.cc |
| diff --git a/remoting/protocol/input_event_tracker.cc b/remoting/protocol/input_event_tracker.cc |
| index 60c4bfd11ebee4007d646bd6ca9b231203764c0c..c7af95bc818e8b13af99c36ca1615b3fedac0cc2 100644 |
| --- a/remoting/protocol/input_event_tracker.cc |
| +++ b/remoting/protocol/input_event_tracker.cc |
| @@ -10,11 +10,7 @@ |
| namespace remoting { |
| namespace protocol { |
| -InputEventTracker::InputEventTracker(InputStub* input_stub) |
| - : input_stub_(input_stub), |
| - mouse_button_state_(0) { |
| -} |
| - |
| +InputEventTracker::InputEventTracker() {} |
| InputEventTracker::~InputEventTracker() {} |
| bool InputEventTracker::IsKeyPressed(ui::DomCode usb_keycode) const { |
| @@ -26,6 +22,8 @@ int InputEventTracker::PressedKeyCount() const { |
| } |
| void InputEventTracker::ReleaseAll() { |
| + DCHECK(input_stub_); |
|
Jamie
2016/03/03 00:18:54
Note that this is different from the previous impl
|
| + |
| // Release all pressed keys. |
| for (auto keycode : pressed_keys_) { |
| KeyEvent event; |
| @@ -91,6 +89,8 @@ void InputEventTracker::ReleaseAllIfModifiersStuck(bool alt_expected, |
| } |
| void InputEventTracker::InjectKeyEvent(const KeyEvent& event) { |
| + DCHECK(input_stub_); |
| + |
| // We don't need to track the keyboard lock states of key down events. |
| // Pressed keys will be released with |lock_states| set to 0. |
| // The lock states of auto generated key up events don't matter as long as |
| @@ -108,10 +108,13 @@ void InputEventTracker::InjectKeyEvent(const KeyEvent& event) { |
| } |
| void InputEventTracker::InjectTextEvent(const TextEvent& event) { |
| + DCHECK(input_stub_); |
| input_stub_->InjectTextEvent(event); |
| } |
| void InputEventTracker::InjectMouseEvent(const MouseEvent& event) { |
| + DCHECK(input_stub_); |
| + |
| if (event.has_x() && event.has_y()) { |
| mouse_pos_ = webrtc::DesktopVector(event.x(), event.y()); |
| } |
| @@ -130,6 +133,7 @@ void InputEventTracker::InjectMouseEvent(const MouseEvent& event) { |
| } |
| void InputEventTracker::InjectTouchEvent(const TouchEvent& event) { |
| + DCHECK(input_stub_); |
| // We only need the IDs to cancel all touch points in ReleaseAll(). Other |
| // fields do not have to be tracked here as long as the host keeps track of |
| // them. |