| Index: remoting/protocol/input_event_tracker.cc
|
| diff --git a/remoting/protocol/input_event_tracker.cc b/remoting/protocol/input_event_tracker.cc
|
| index 446a4b623898424f8e94afa7ead2a3e2d66175e7..d882d60330950f6c6201522330a119ae319c6e56 100644
|
| --- a/remoting/protocol/input_event_tracker.cc
|
| +++ b/remoting/protocol/input_event_tracker.cc
|
| @@ -5,6 +5,7 @@
|
| #include "remoting/protocol/input_event_tracker.h"
|
|
|
| #include "base/logging.h"
|
| +#include "base/stl_util.h"
|
| #include "remoting/proto/event.pb.h"
|
|
|
| namespace remoting {
|
| @@ -51,6 +52,18 @@ void InputEventTracker::ReleaseAll() {
|
| }
|
| }
|
| mouse_button_state_ = 0;
|
| +
|
| + if (!touch_point_ids_.empty()) {
|
| + TouchEvent cancel_all_touch_event;
|
| + cancel_all_touch_event.set_event_type(TouchEvent::TOUCH_POINT_CANCEL);
|
| + for (uint32 touch_point_id : touch_point_ids_) {
|
| + TouchEventPoint* point = cancel_all_touch_event.add_touch_points();
|
| + point->set_id(touch_point_id);
|
| + }
|
| + input_stub_->InjectTouchEvent(cancel_all_touch_event);
|
| + touch_point_ids_.clear();
|
| + }
|
| + DCHECK(touch_point_ids_.empty());
|
| }
|
|
|
| void InputEventTracker::InjectKeyEvent(const KeyEvent& event) {
|
| @@ -92,5 +105,28 @@ void InputEventTracker::InjectMouseEvent(const MouseEvent& event) {
|
| input_stub_->InjectMouseEvent(event);
|
| }
|
|
|
| +void InputEventTracker::InjectTouchEvent(const TouchEvent& event) {
|
| + switch (event.event_type()) {
|
| + case TouchEvent::TOUCH_POINT_START:
|
| + for (const TouchEventPoint& touch_point : event.touch_points()) {
|
| + DCHECK(touch_point_ids_.find(touch_point.id()) ==
|
| + touch_point_ids_.end());
|
| + touch_point_ids_.insert(touch_point.id());
|
| + }
|
| + break;
|
| + case TouchEvent::TOUCH_POINT_END:
|
| + case TouchEvent::TOUCH_POINT_CANCEL:
|
| + for (const TouchEventPoint& touch_point : event.touch_points()) {
|
| + DCHECK(touch_point_ids_.find(touch_point.id()) !=
|
| + touch_point_ids_.end());
|
| + touch_point_ids_.erase(touch_point.id());
|
| + }
|
| + break;
|
| + default:
|
| + break;
|
| + }
|
| + input_stub_->InjectTouchEvent(event);
|
| +}
|
| +
|
| } // namespace protocol
|
| } // namespace remoting
|
|
|