| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef REMOTING_HOST_REMOTE_INPUT_FILTER_H_ | 5 #ifndef REMOTING_HOST_REMOTE_INPUT_FILTER_H_ |
| 6 #define REMOTING_HOST_REMOTE_INPUT_FILTER_H_ | 6 #define REMOTING_HOST_REMOTE_INPUT_FILTER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // and block remote input for a short while. | 29 // and block remote input for a short while. |
| 30 void LocalMouseMoved(const webrtc::DesktopVector& mouse_pos); | 30 void LocalMouseMoved(const webrtc::DesktopVector& mouse_pos); |
| 31 | 31 |
| 32 // Informs the filter that injecting input causes an echo. | 32 // Informs the filter that injecting input causes an echo. |
| 33 void SetExpectLocalEcho(bool expect_local_echo); | 33 void SetExpectLocalEcho(bool expect_local_echo); |
| 34 | 34 |
| 35 // InputStub overrides. | 35 // InputStub overrides. |
| 36 void InjectKeyEvent(const protocol::KeyEvent& event) override; | 36 void InjectKeyEvent(const protocol::KeyEvent& event) override; |
| 37 void InjectTextEvent(const protocol::TextEvent& event) override; | 37 void InjectTextEvent(const protocol::TextEvent& event) override; |
| 38 void InjectMouseEvent(const protocol::MouseEvent& event) override; | 38 void InjectMouseEvent(const protocol::MouseEvent& event) override; |
| 39 void InjectTouchEvent(const protocol::TouchEvent& event) override; |
| 39 | 40 |
| 40 private: | 41 private: |
| 41 bool ShouldIgnoreInput() const; | 42 bool ShouldIgnoreInput() const; |
| 42 | 43 |
| 43 protocol::InputEventTracker* event_tracker_; | 44 protocol::InputEventTracker* event_tracker_; |
| 44 | 45 |
| 45 // Queue of recently-injected mouse positions used to distinguish echoes of | 46 // Queue of recently-injected mouse positions used to distinguish echoes of |
| 46 // injected events from movements from a local input device. | 47 // injected events from movements from a local input device. |
| 47 std::list<webrtc::DesktopVector> injected_mouse_positions_; | 48 std::list<webrtc::DesktopVector> injected_mouse_positions_; |
| 48 | 49 |
| 49 // Time at which local input events were most recently observed. | 50 // Time at which local input events were most recently observed. |
| 50 base::TimeTicks latest_local_input_time_; | 51 base::TimeTicks latest_local_input_time_; |
| 51 | 52 |
| 52 // If |true| than the filter assumes that injecting input causes an echo. | 53 // If |true| than the filter assumes that injecting input causes an echo. |
| 53 bool expect_local_echo_; | 54 bool expect_local_echo_; |
| 54 | 55 |
| 55 DISALLOW_COPY_AND_ASSIGN(RemoteInputFilter); | 56 DISALLOW_COPY_AND_ASSIGN(RemoteInputFilter); |
| 56 }; | 57 }; |
| 57 | 58 |
| 58 } // namespace remoting | 59 } // namespace remoting |
| 59 | 60 |
| 60 #endif // REMOTING_HOST_REMOTE_INPUT_FILTER_H_ | 61 #endif // REMOTING_HOST_REMOTE_INPUT_FILTER_H_ |
| OLD | NEW |