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

Side by Side 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: backup 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "base/ref_counted.h"
5 #include "net/base/io_buffer.h" 6 #include "net/base/io_buffer.h"
6 #include "remoting/base/multiple_array_input_stream.h" 7 #include "remoting/base/multiple_array_input_stream.h"
7 #include "remoting/proto/control.pb.h" 8 #include "remoting/proto/control.pb.h"
8 #include "remoting/proto/event.pb.h" 9 #include "remoting/proto/event.pb.h"
9 #include "remoting/protocol/host_message_dispatcher.h" 10 #include "remoting/protocol/host_message_dispatcher.h"
10 #include "remoting/protocol/host_stub.h" 11 #include "remoting/protocol/host_stub.h"
11 #include "remoting/protocol/input_stub.h" 12 #include "remoting/protocol/input_stub.h"
12 #include "remoting/protocol/message_reader.h" 13 #include "remoting/protocol/message_reader.h"
13 #include "remoting/protocol/session.h" 14 #include "remoting/protocol/session.h"
14 15
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 session->control_channel(), 72 session->control_channel(),
72 NewCallback(this, &HostMessageDispatcher::OnControlMessageReceived)); 73 NewCallback(this, &HostMessageDispatcher::OnControlMessageReceived));
73 return true; 74 return true;
74 } 75 }
75 76
76 void HostMessageDispatcher::OnControlMessageReceived(ControlMessage* message) { 77 void HostMessageDispatcher::OnControlMessageReceived(ControlMessage* message) {
77 scoped_refptr<RefCountedMessage<ControlMessage> > ref_msg = 78 scoped_refptr<RefCountedMessage<ControlMessage> > ref_msg =
78 new RefCountedMessage<ControlMessage>(message); 79 new RefCountedMessage<ControlMessage>(message);
79 if (message->has_suggest_resolution()) { 80 if (message->has_suggest_resolution()) {
80 host_stub_->SuggestResolution( 81 host_stub_->SuggestResolution(
81 message->suggest_resolution(), NewDeleteTask(ref_msg)); 82 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.
82 } 83 }
83 } 84 }
84 85
85 void HostMessageDispatcher::OnEventMessageReceived( 86 void HostMessageDispatcher::OnEventMessageReceived(
86 EventMessage* message) { 87 EventMessage* message) {
87 // TODO(hclam): Implement. 88 scoped_refptr<RefCountedMessage<EventMessage> > ref_msg =
89 new RefCountedMessage<EventMessage>(message);
90 for (int i = 0; i < message->event_size(); ++i) {
91 if (message->event(i).has_key()) {
92 input_stub_->InjectKeyEvent(
93 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.
94 }
95 if (message->event(i).has_mouse()) {
96 input_stub_->InjectMouseEvent(
97 message->mutable_event(i)->mutable_mouse(), NewDeleteTask(ref_msg));
98 }
99 }
88 } 100 }
89 101
90 } // namespace protocol 102 } // namespace protocol
91 } // namespace remoting 103 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698