| 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 #ifndef REMOTING_PROTOCOL_HOST_CONTROL_DISPATCHER_H_ | 5 #ifndef REMOTING_PROTOCOL_HOST_CONTROL_DISPATCHER_H_ |
| 6 #define REMOTING_PROTOCOL_HOST_CONTROL_DISPATCHER_H_ | 6 #define REMOTING_PROTOCOL_HOST_CONTROL_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "remoting/protocol/channel_dispatcher_base.h" | 9 #include "remoting/protocol/channel_dispatcher_base.h" |
| 10 #include "remoting/protocol/client_stub.h" | 10 #include "remoting/protocol/client_stub.h" |
| 11 #include "remoting/protocol/clipboard_stub.h" | 11 #include "remoting/protocol/clipboard_stub.h" |
| 12 #include "remoting/protocol/message_reader.h" | 12 #include "remoting/protocol/message_reader.h" |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 class StreamSocket; | 15 class StreamSocket; |
| 16 } // namespace net | 16 } // namespace net |
| 17 | 17 |
| 18 namespace remoting { | 18 namespace remoting { |
| 19 namespace protocol { | 19 namespace protocol { |
| 20 | 20 |
| 21 class BufferedSocketWriter; | 21 class BufferedSocketWriter; |
| 22 class ControlMessage; | 22 class ControlMessage; |
| 23 class HostStub; | 23 class HostStub; |
| 24 class Session; | 24 class Session; |
| 25 | 25 |
| 26 // HostControlDispatcher dispatches incoming messages on the control | 26 // HostControlDispatcher dispatches incoming messages on the control |
| 27 // channel to HostStub or ClipboardStub, and also implements ClientStub and | 27 // channel to HostStub or ClipboardStub, and also implements ClientStub for |
| 28 // ClipboardStub for outgoing messages. | 28 // outgoing messages. |
| 29 class HostControlDispatcher : public ChannelDispatcherBase, public ClientStub, | 29 class HostControlDispatcher : public ChannelDispatcherBase, public ClientStub { |
| 30 public ClipboardStub { | |
| 31 public: | 30 public: |
| 32 HostControlDispatcher(); | 31 HostControlDispatcher(); |
| 33 virtual ~HostControlDispatcher(); | 32 virtual ~HostControlDispatcher(); |
| 34 | 33 |
| 35 // ClipboardStub implementation. | 34 // ClipboardStub implementation. |
| 36 virtual void InjectClipboardEvent(const ClipboardEvent& event) OVERRIDE; | 35 virtual void InjectClipboardEvent(const ClipboardEvent& event) OVERRIDE; |
| 37 | 36 |
| 38 // Sets the ClipboardStub that will be called for each incoming clipboard | 37 // Sets the ClipboardStub that will be called for each incoming clipboard |
| 39 // message. |clipboard_stub| must outlive this object. | 38 // message. |clipboard_stub| must outlive this object. |
| 40 void set_clipboard_stub(ClipboardStub* clipboard_stub) { | 39 void set_clipboard_stub(ClipboardStub* clipboard_stub) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 59 ProtobufMessageReader<ControlMessage> reader_; | 58 ProtobufMessageReader<ControlMessage> reader_; |
| 60 scoped_refptr<BufferedSocketWriter> writer_; | 59 scoped_refptr<BufferedSocketWriter> writer_; |
| 61 | 60 |
| 62 DISALLOW_COPY_AND_ASSIGN(HostControlDispatcher); | 61 DISALLOW_COPY_AND_ASSIGN(HostControlDispatcher); |
| 63 }; | 62 }; |
| 64 | 63 |
| 65 } // namespace protocol | 64 } // namespace protocol |
| 66 } // namespace remoting | 65 } // namespace remoting |
| 67 | 66 |
| 68 #endif // REMOTING_PROTOCOL_HOST_CONTROL_DISPATCHER_H_ | 67 #endif // REMOTING_PROTOCOL_HOST_CONTROL_DISPATCHER_H_ |
| OLD | NEW |