summaryrefslogtreecommitdiffstats
path: root/remoting/protocol/host_message_dispatcher.cc
diff options
context:
space:
mode:
Diffstat (limited to 'remoting/protocol/host_message_dispatcher.cc')
-rw-r--r--remoting/protocol/host_message_dispatcher.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/remoting/protocol/host_message_dispatcher.cc b/remoting/protocol/host_message_dispatcher.cc
index 7ad9cac..13fa803 100644
--- a/remoting/protocol/host_message_dispatcher.cc
+++ b/remoting/protocol/host_message_dispatcher.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/ref_counted.h"
#include "net/base/io_buffer.h"
#include "remoting/proto/control.pb.h"
#include "remoting/proto/event.pb.h"
@@ -77,13 +78,24 @@ void HostMessageDispatcher::OnControlMessageReceived(ControlMessage* message) {
new RefCountedMessage<ControlMessage>(message);
if (message->has_suggest_resolution()) {
host_stub_->SuggestResolution(
- message->suggest_resolution(), NewDeleteTask(ref_msg));
+ &message->suggest_resolution(), NewDeleteTask(ref_msg));
}
}
void HostMessageDispatcher::OnEventMessageReceived(
EventMessage* message) {
- // TODO(hclam): Implement.
+ scoped_refptr<RefCountedMessage<EventMessage> > ref_msg =
+ new RefCountedMessage<EventMessage>(message);
+ for (int i = 0; i < message->event_size(); ++i) {
+ if (message->event(i).has_key()) {
+ input_stub_->InjectKeyEvent(
+ &message->event(i).key(), NewDeleteTask(ref_msg));
+ }
+ if (message->event(i).has_mouse()) {
+ input_stub_->InjectMouseEvent(
+ &message->event(i).mouse(), NewDeleteTask(ref_msg));
+ }
+ }
}
} // namespace protocol