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 #include "remoting/protocol/client_event_dispatcher.h" | 5 #include "remoting/protocol/client_event_dispatcher.h" |
6 | 6 |
7 #include "base/message_loop/message_loop_proxy.h" | 7 #include "base/message_loop/message_loop_proxy.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "net/socket/stream_socket.h" | 9 #include "net/socket/stream_socket.h" |
10 #include "remoting/base/constants.h" | 10 #include "remoting/base/constants.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 writer()->Write(SerializeAndFrameMessage(message), base::Closure()); | 39 writer()->Write(SerializeAndFrameMessage(message), base::Closure()); |
40 } | 40 } |
41 | 41 |
42 void ClientEventDispatcher::InjectMouseEvent(const MouseEvent& event) { | 42 void ClientEventDispatcher::InjectMouseEvent(const MouseEvent& event) { |
43 EventMessage message; | 43 EventMessage message; |
44 message.set_timestamp(base::Time::Now().ToInternalValue()); | 44 message.set_timestamp(base::Time::Now().ToInternalValue()); |
45 message.mutable_mouse_event()->CopyFrom(event); | 45 message.mutable_mouse_event()->CopyFrom(event); |
46 writer()->Write(SerializeAndFrameMessage(message), base::Closure()); | 46 writer()->Write(SerializeAndFrameMessage(message), base::Closure()); |
47 } | 47 } |
48 | 48 |
| 49 void ClientEventDispatcher::InjectTouchEvent(const TouchEvent& event) { |
| 50 EventMessage message; |
| 51 message.set_timestamp(base::Time::Now().ToInternalValue()); |
| 52 message.mutable_touch_event()->CopyFrom(event); |
| 53 writer()->Write(SerializeAndFrameMessage(message), base::Closure()); |
| 54 } |
| 55 |
49 } // namespace protocol | 56 } // namespace protocol |
50 } // namespace remoting | 57 } // namespace remoting |
OLD | NEW |