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" | |
9 #include "remoting/protocol/buffered_socket_writer.h" | 8 #include "remoting/protocol/buffered_socket_writer.h" |
10 #include "remoting/protocol/channel_dispatcher_base.h" | 9 #include "remoting/protocol/channel_dispatcher_base.h" |
11 #include "remoting/protocol/client_stub.h" | 10 #include "remoting/protocol/client_stub.h" |
12 #include "remoting/protocol/clipboard_stub.h" | 11 #include "remoting/protocol/clipboard_stub.h" |
13 #include "remoting/protocol/cursor_shape_stub.h" | 12 #include "remoting/protocol/cursor_shape_stub.h" |
14 #include "remoting/protocol/message_reader.h" | 13 #include "remoting/protocol/message_reader.h" |
15 | 14 |
16 namespace net { | 15 namespace net { |
17 class StreamSocket; | 16 class StreamSocket; |
18 } // namespace net | 17 } // namespace net |
19 | 18 |
20 namespace remoting { | 19 namespace remoting { |
21 namespace protocol { | 20 namespace protocol { |
22 | 21 |
23 class ControlMessage; | 22 class ControlMessage; |
24 class HostStub; | 23 class HostStub; |
| 24 class PairingResponse; |
25 class Session; | 25 class Session; |
26 | 26 |
27 // HostControlDispatcher dispatches incoming messages on the control | 27 // HostControlDispatcher dispatches incoming messages on the control |
28 // channel to HostStub or ClipboardStub, and also implements ClientStub and | 28 // channel to HostStub or ClipboardStub, and also implements ClientStub and |
29 // CursorShapeStub for outgoing messages. | 29 // CursorShapeStub for outgoing messages. |
30 class HostControlDispatcher : public ChannelDispatcherBase, | 30 class HostControlDispatcher : public ChannelDispatcherBase, |
31 public ClientStub { | 31 public ClientStub { |
32 public: | 32 public: |
33 HostControlDispatcher(); | 33 HostControlDispatcher(); |
34 virtual ~HostControlDispatcher(); | 34 virtual ~HostControlDispatcher(); |
35 | 35 |
36 // ClientStub implementation. | 36 // ClientStub implementation. |
37 virtual void SetCapabilities(const Capabilities& capabilities) OVERRIDE; | 37 virtual void SetCapabilities(const Capabilities& capabilities) OVERRIDE; |
| 38 virtual void SetPairingResponse( |
| 39 const PairingResponse& pairing_response) OVERRIDE; |
38 | 40 |
39 // ClipboardStub implementation for sending clipboard data to client. | 41 // ClipboardStub implementation for sending clipboard data to client. |
40 virtual void InjectClipboardEvent(const ClipboardEvent& event) OVERRIDE; | 42 virtual void InjectClipboardEvent(const ClipboardEvent& event) OVERRIDE; |
41 | 43 |
42 // CursorShapeStub implementation for sending cursor shape to client. | 44 // CursorShapeStub implementation for sending cursor shape to client. |
43 virtual void SetCursorShape(const CursorShapeInfo& cursor_shape) OVERRIDE; | 45 virtual void SetCursorShape(const CursorShapeInfo& cursor_shape) OVERRIDE; |
44 | 46 |
45 // Sets the ClipboardStub that will be called for each incoming clipboard | 47 // Sets the ClipboardStub that will be called for each incoming clipboard |
46 // message. |clipboard_stub| must outlive this object. | 48 // message. |clipboard_stub| must outlive this object. |
47 void set_clipboard_stub(ClipboardStub* clipboard_stub) { | 49 void set_clipboard_stub(ClipboardStub* clipboard_stub) { |
(...skipping 18 matching lines...) Expand all Loading... |
66 ProtobufMessageReader<ControlMessage> reader_; | 68 ProtobufMessageReader<ControlMessage> reader_; |
67 BufferedSocketWriter writer_; | 69 BufferedSocketWriter writer_; |
68 | 70 |
69 DISALLOW_COPY_AND_ASSIGN(HostControlDispatcher); | 71 DISALLOW_COPY_AND_ASSIGN(HostControlDispatcher); |
70 }; | 72 }; |
71 | 73 |
72 } // namespace protocol | 74 } // namespace protocol |
73 } // namespace remoting | 75 } // namespace remoting |
74 | 76 |
75 #endif // REMOTING_PROTOCOL_HOST_CONTROL_DISPATCHER_H_ | 77 #endif // REMOTING_PROTOCOL_HOST_CONTROL_DISPATCHER_H_ |
OLD | NEW |