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

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: fixed 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..de2a419b079c06e84743d37b7305e25da94e2d17 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->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

Powered by Google App Engine
This is Rietveld 408576698