| 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_CLIENT_CONTROL_DISPATCHER_H_ | 5 #ifndef REMOTING_PROTOCOL_CLIENT_CONTROL_DISPATCHER_H_ |
| 6 #define REMOTING_PROTOCOL_CLIENT_CONTROL_DISPATCHER_H_ | 6 #define REMOTING_PROTOCOL_CLIENT_CONTROL_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "remoting/protocol/channel_dispatcher_base.h" | 10 #include "remoting/protocol/channel_dispatcher_base.h" |
| 11 #include "remoting/protocol/clipboard_stub.h" | 11 #include "remoting/protocol/clipboard_stub.h" |
| 12 #include "remoting/protocol/cursor_shape_stub.h" | 12 #include "remoting/protocol/cursor_shape_stub.h" |
| 13 #include "remoting/protocol/host_stub.h" | 13 #include "remoting/protocol/host_stub.h" |
| 14 #include "remoting/protocol/protobuf_message_parser.h" | |
| 15 | 14 |
| 16 namespace remoting { | 15 namespace remoting { |
| 17 namespace protocol { | 16 namespace protocol { |
| 18 | 17 |
| 19 class ClientStub; | 18 class ClientStub; |
| 20 class ControlMessage; | 19 class ControlMessage; |
| 21 class Session; | 20 class Session; |
| 22 | 21 |
| 23 // ClientControlDispatcher dispatches incoming messages on the control | 22 // ClientControlDispatcher dispatches incoming messages on the control |
| 24 // channel to ClientStub, ClipboardStub or CursorShapeStub. | 23 // channel to ClientStub, ClipboardStub or CursorShapeStub. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 45 // message. |client_stub| must outlive this object. | 44 // message. |client_stub| must outlive this object. |
| 46 void set_client_stub(ClientStub* client_stub) { client_stub_ = client_stub; } | 45 void set_client_stub(ClientStub* client_stub) { client_stub_ = client_stub; } |
| 47 | 46 |
| 48 // Sets the ClipboardStub that will be called for each incoming clipboard | 47 // Sets the ClipboardStub that will be called for each incoming clipboard |
| 49 // message. |clipboard_stub| must outlive this object. | 48 // message. |clipboard_stub| must outlive this object. |
| 50 void set_clipboard_stub(ClipboardStub* clipboard_stub) { | 49 void set_clipboard_stub(ClipboardStub* clipboard_stub) { |
| 51 clipboard_stub_ = clipboard_stub; | 50 clipboard_stub_ = clipboard_stub; |
| 52 } | 51 } |
| 53 | 52 |
| 54 private: | 53 private: |
| 55 void OnMessageReceived(scoped_ptr<ControlMessage> message); | 54 void OnIncomingMessage(scoped_ptr<CompoundBuffer> message) override; |
| 56 | 55 |
| 57 ClientStub* client_stub_; | 56 ClientStub* client_stub_ = nullptr; |
| 58 ClipboardStub* clipboard_stub_; | 57 ClipboardStub* clipboard_stub_ = nullptr; |
| 59 | |
| 60 ProtobufMessageParser<ControlMessage> parser_; | |
| 61 | 58 |
| 62 DISALLOW_COPY_AND_ASSIGN(ClientControlDispatcher); | 59 DISALLOW_COPY_AND_ASSIGN(ClientControlDispatcher); |
| 63 }; | 60 }; |
| 64 | 61 |
| 65 } // namespace protocol | 62 } // namespace protocol |
| 66 } // namespace remoting | 63 } // namespace remoting |
| 67 | 64 |
| 68 #endif // REMOTING_PROTOCOL_CLIENT_CONTROL_DISPATCHER_H_ | 65 #endif // REMOTING_PROTOCOL_CLIENT_CONTROL_DISPATCHER_H_ |
| OLD | NEW |