Index: remoting/protocol/host_message_dispatcher.cc |
diff --git a/remoting/protocol/host_message_dispatcher.cc b/remoting/protocol/host_message_dispatcher.cc |
index d75de95e197c22a99929ec16d28497c09a66c669..af62b249ce96d292f8508233ce28966c758f829a 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/base/multiple_array_input_stream.h" |
#include "remoting/proto/control.pb.h" |
@@ -78,13 +79,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->mutable_suggest_resolution(), NewDeleteTask(ref_msg)); |
awong
2010/11/12 01:40:10
why do we need this to be mutable?
Alpha Left Google
2010/11/12 22:56:40
Done.
Alpha Left Google
2010/11/12 22:56:40
Done.
|
} |
} |
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->mutable_event(i)->mutable_key(), NewDeleteTask(ref_msg)); |
awong
2010/11/12 01:40:10
Why are all these mutable?
Alpha Left Google
2010/11/12 22:56:40
Done.
|
+ } |
+ if (message->event(i).has_mouse()) { |
+ input_stub_->InjectMouseEvent( |
+ message->mutable_event(i)->mutable_mouse(), NewDeleteTask(ref_msg)); |
+ } |
+ } |
} |
} // namespace protocol |