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 "remoting/protocol/buffered_socket_writer.h" | 8 #include "remoting/protocol/buffered_socket_writer.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" |
(...skipping 16 matching lines...) Expand all Loading... |
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( | 38 virtual void SetPairingResponse( |
39 const PairingResponse& pairing_response) OVERRIDE; | 39 const PairingResponse& pairing_response) override; |
40 virtual void DeliverHostMessage( | 40 virtual void DeliverHostMessage( |
41 const ExtensionMessage& message) OVERRIDE; | 41 const ExtensionMessage& message) override; |
42 | 42 |
43 // ClipboardStub implementation for sending clipboard data to client. | 43 // ClipboardStub implementation for sending clipboard data to client. |
44 virtual void InjectClipboardEvent(const ClipboardEvent& event) OVERRIDE; | 44 virtual void InjectClipboardEvent(const ClipboardEvent& event) override; |
45 | 45 |
46 // CursorShapeStub implementation for sending cursor shape to client. | 46 // CursorShapeStub implementation for sending cursor shape to client. |
47 virtual void SetCursorShape(const CursorShapeInfo& cursor_shape) OVERRIDE; | 47 virtual void SetCursorShape(const CursorShapeInfo& cursor_shape) override; |
48 | 48 |
49 // Sets the ClipboardStub that will be called for each incoming clipboard | 49 // Sets the ClipboardStub that will be called for each incoming clipboard |
50 // message. |clipboard_stub| must outlive this object. | 50 // message. |clipboard_stub| must outlive this object. |
51 void set_clipboard_stub(ClipboardStub* clipboard_stub) { | 51 void set_clipboard_stub(ClipboardStub* clipboard_stub) { |
52 clipboard_stub_ = clipboard_stub; | 52 clipboard_stub_ = clipboard_stub; |
53 } | 53 } |
54 | 54 |
55 // Sets the HostStub that will be called for each incoming control | 55 // Sets the HostStub that will be called for each incoming control |
56 // message. |host_stub| must outlive this object. | 56 // message. |host_stub| must outlive this object. |
57 void set_host_stub(HostStub* host_stub) { host_stub_ = host_stub; } | 57 void set_host_stub(HostStub* host_stub) { host_stub_ = host_stub; } |
58 | 58 |
59 protected: | 59 protected: |
60 // ChannelDispatcherBase overrides. | 60 // ChannelDispatcherBase overrides. |
61 virtual void OnInitialized() OVERRIDE; | 61 virtual void OnInitialized() override; |
62 | 62 |
63 private: | 63 private: |
64 void OnMessageReceived(scoped_ptr<ControlMessage> message, | 64 void OnMessageReceived(scoped_ptr<ControlMessage> message, |
65 const base::Closure& done_task); | 65 const base::Closure& done_task); |
66 | 66 |
67 ClipboardStub* clipboard_stub_; | 67 ClipboardStub* clipboard_stub_; |
68 HostStub* host_stub_; | 68 HostStub* host_stub_; |
69 | 69 |
70 ProtobufMessageReader<ControlMessage> reader_; | 70 ProtobufMessageReader<ControlMessage> reader_; |
71 BufferedSocketWriter writer_; | 71 BufferedSocketWriter writer_; |
72 | 72 |
73 DISALLOW_COPY_AND_ASSIGN(HostControlDispatcher); | 73 DISALLOW_COPY_AND_ASSIGN(HostControlDispatcher); |
74 }; | 74 }; |
75 | 75 |
76 } // namespace protocol | 76 } // namespace protocol |
77 } // namespace remoting | 77 } // namespace remoting |
78 | 78 |
79 #endif // REMOTING_PROTOCOL_HOST_CONTROL_DISPATCHER_H_ | 79 #endif // REMOTING_PROTOCOL_HOST_CONTROL_DISPATCHER_H_ |
OLD | NEW |