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

Side by Side Diff: remoting/protocol/host_control_dispatcher.cc

Issue 10382184: [Chromoting] Initial plumbing for cursor shape. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove extra LOGs Created 8 years, 7 months 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "remoting/protocol/host_control_dispatcher.h" 5 #include "remoting/protocol/host_control_dispatcher.h"
6 6
7 #include "base/message_loop_proxy.h" 7 #include "base/message_loop_proxy.h"
8 #include "net/socket/stream_socket.h" 8 #include "net/socket/stream_socket.h"
9 #include "remoting/base/constants.h" 9 #include "remoting/base/constants.h"
10 #include "remoting/proto/control.pb.h" 10 #include "remoting/proto/control.pb.h"
(...skipping 22 matching lines...) Expand all
33 &HostControlDispatcher::OnMessageReceived, base::Unretained(this))); 33 &HostControlDispatcher::OnMessageReceived, base::Unretained(this)));
34 writer_->Init(channel(), BufferedSocketWriter::WriteFailedCallback()); 34 writer_->Init(channel(), BufferedSocketWriter::WriteFailedCallback());
35 } 35 }
36 36
37 void HostControlDispatcher::InjectClipboardEvent(const ClipboardEvent& event) { 37 void HostControlDispatcher::InjectClipboardEvent(const ClipboardEvent& event) {
38 ControlMessage message; 38 ControlMessage message;
39 message.mutable_clipboard_event()->CopyFrom(event); 39 message.mutable_clipboard_event()->CopyFrom(event);
40 writer_->Write(SerializeAndFrameMessage(message), base::Closure()); 40 writer_->Write(SerializeAndFrameMessage(message), base::Closure());
41 } 41 }
42 42
43 void HostControlDispatcher::SetCursorShape(
44 const CursorShapeInfo& cursor_shape) {
45 ControlMessage message;
46 message.mutable_cursor_shape()->CopyFrom(cursor_shape);
47 writer_->Write(SerializeAndFrameMessage(message), base::Closure());
48 }
49
43 void HostControlDispatcher::OnMessageReceived( 50 void HostControlDispatcher::OnMessageReceived(
44 scoped_ptr<ControlMessage> message, const base::Closure& done_task) { 51 scoped_ptr<ControlMessage> message, const base::Closure& done_task) {
45 DCHECK(clipboard_stub_); 52 DCHECK(clipboard_stub_);
46 DCHECK(host_stub_); 53 DCHECK(host_stub_);
47 54
48 base::ScopedClosureRunner done_runner(done_task); 55 base::ScopedClosureRunner done_runner(done_task);
49 56
50 if (message->has_clipboard_event()) { 57 if (message->has_clipboard_event()) {
51 clipboard_stub_->InjectClipboardEvent(message->clipboard_event()); 58 clipboard_stub_->InjectClipboardEvent(message->clipboard_event());
52 } else if (message->has_client_dimensions()) { 59 } else if (message->has_client_dimensions()) {
53 host_stub_->NotifyClientDimensions(message->client_dimensions()); 60 host_stub_->NotifyClientDimensions(message->client_dimensions());
54 } else if (message->has_video_control()) { 61 } else if (message->has_video_control()) {
55 host_stub_->ControlVideo(message->video_control()); 62 host_stub_->ControlVideo(message->video_control());
56 } else { 63 } else {
57 LOG(WARNING) << "Unknown control message received."; 64 LOG(WARNING) << "Unknown control message received.";
58 } 65 }
59 } 66 }
60 67
61 } // namespace protocol 68 } // namespace protocol
62 } // namespace remoting 69 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698