| OLD | NEW |
| 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/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "net/socket/stream_socket.h" | 8 #include "net/socket/stream_socket.h" |
| 9 #include "remoting/base/compound_buffer.h" | 9 #include "remoting/base/compound_buffer.h" |
| 10 #include "remoting/base/constants.h" | 10 #include "remoting/base/constants.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 message_pipe()->Send(&message, base::Closure()); | 36 message_pipe()->Send(&message, base::Closure()); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void HostControlDispatcher::DeliverHostMessage( | 39 void HostControlDispatcher::DeliverHostMessage( |
| 40 const ExtensionMessage& message) { | 40 const ExtensionMessage& message) { |
| 41 ControlMessage control_message; | 41 ControlMessage control_message; |
| 42 control_message.mutable_extension_message()->CopyFrom(message); | 42 control_message.mutable_extension_message()->CopyFrom(message); |
| 43 message_pipe()->Send(&control_message, base::Closure()); | 43 message_pipe()->Send(&control_message, base::Closure()); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void HostControlDispatcher::SetVideoLayout(const VideoLayout& layout) { |
| 47 ControlMessage message; |
| 48 message.mutable_video_layout()->CopyFrom(layout); |
| 49 message_pipe()->Send(&message, base::Closure()); |
| 50 } |
| 51 |
| 46 void HostControlDispatcher::InjectClipboardEvent(const ClipboardEvent& event) { | 52 void HostControlDispatcher::InjectClipboardEvent(const ClipboardEvent& event) { |
| 47 ControlMessage message; | 53 ControlMessage message; |
| 48 message.mutable_clipboard_event()->CopyFrom(event); | 54 message.mutable_clipboard_event()->CopyFrom(event); |
| 49 message_pipe()->Send(&message, base::Closure()); | 55 message_pipe()->Send(&message, base::Closure()); |
| 50 } | 56 } |
| 51 | 57 |
| 52 void HostControlDispatcher::SetCursorShape( | 58 void HostControlDispatcher::SetCursorShape( |
| 53 const CursorShapeInfo& cursor_shape) { | 59 const CursorShapeInfo& cursor_shape) { |
| 54 ControlMessage message; | 60 ControlMessage message; |
| 55 message.mutable_cursor_shape()->CopyFrom(cursor_shape); | 61 message.mutable_cursor_shape()->CopyFrom(cursor_shape); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 80 host_stub_->RequestPairing(message->pairing_request()); | 86 host_stub_->RequestPairing(message->pairing_request()); |
| 81 } else if (message->has_extension_message()) { | 87 } else if (message->has_extension_message()) { |
| 82 host_stub_->DeliverClientMessage(message->extension_message()); | 88 host_stub_->DeliverClientMessage(message->extension_message()); |
| 83 } else { | 89 } else { |
| 84 LOG(WARNING) << "Unknown control message received."; | 90 LOG(WARNING) << "Unknown control message received."; |
| 85 } | 91 } |
| 86 } | 92 } |
| 87 | 93 |
| 88 } // namespace protocol | 94 } // namespace protocol |
| 89 } // namespace remoting | 95 } // namespace remoting |
| OLD | NEW |