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

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

Issue 10223019: Add ClientDimensions message to control channel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add missing HostMockStub method. Created 8 years, 8 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/client_control_dispatcher.h" 5 #include "remoting/protocol/client_control_dispatcher.h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "net/socket/stream_socket.h" 10 #include "net/socket/stream_socket.h"
(...skipping 25 matching lines...) Expand all
36 &ClientControlDispatcher::OnMessageReceived, base::Unretained(this))); 36 &ClientControlDispatcher::OnMessageReceived, base::Unretained(this)));
37 } 37 }
38 38
39 void ClientControlDispatcher::InjectClipboardEvent( 39 void ClientControlDispatcher::InjectClipboardEvent(
40 const ClipboardEvent& event) { 40 const ClipboardEvent& event) {
41 ControlMessage message; 41 ControlMessage message;
42 message.mutable_clipboard_event()->CopyFrom(event); 42 message.mutable_clipboard_event()->CopyFrom(event);
43 writer_->Write(SerializeAndFrameMessage(message), base::Closure()); 43 writer_->Write(SerializeAndFrameMessage(message), base::Closure());
44 } 44 }
45 45
46 void ClientControlDispatcher::NotifyClientDimensions(
47 const ClientDimensions& dimensions) {
48 ControlMessage message;
49 message.mutable_client_dimensions()->CopyFrom(dimensions);
50 writer_->Write(SerializeAndFrameMessage(message), base::Closure());
51 }
52
46 void ClientControlDispatcher::OnMessageReceived( 53 void ClientControlDispatcher::OnMessageReceived(
47 scoped_ptr<ControlMessage> message, const base::Closure& done_task) { 54 scoped_ptr<ControlMessage> message, const base::Closure& done_task) {
48 DCHECK(client_stub_); 55 DCHECK(client_stub_);
49 DCHECK(clipboard_stub_); 56 DCHECK(clipboard_stub_);
50 base::ScopedClosureRunner done_runner(done_task); 57 base::ScopedClosureRunner done_runner(done_task);
51 58
52 if (message->has_clipboard_event()) { 59 if (message->has_clipboard_event()) {
53 clipboard_stub_->InjectClipboardEvent(message->clipboard_event()); 60 clipboard_stub_->InjectClipboardEvent(message->clipboard_event());
54 } else { 61 } else {
55 LOG(WARNING) << "Unknown control message received."; 62 LOG(WARNING) << "Unknown control message received.";
56 } 63 }
57 } 64 }
58 65
59 } // namespace protocol 66 } // namespace protocol
60 } // namespace remoting 67 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/client_control_dispatcher.h ('k') | remoting/protocol/host_control_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698