Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1361)

Unified Diff: remoting/protocol/host_message_dispatcher.cc

Issue 4726003: Implement InputStub in the host side for chromoting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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));
Sergey Ulanov 2010/11/10 20:14:21 &message->suggest_resolution()?
Alpha Left Google 2010/11/12 20:08:01 That shouldn't make a difference since callee see
Sergey Ulanov 2010/11/12 20:30:33 Yes, but immutable version should be preferred her
}
}
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));
+ }
+ if (message->event(i).has_mouse()) {
+ input_stub_->InjectMouseEvent(
+ message->mutable_event(i)->mutable_mouse(), NewDeleteTask(ref_msg));
+ }
+ }
}
} // namespace protocol

Powered by Google App Engine
This is Rietveld 408576698