[email protected] | 399b4f6 | 2014-05-30 20:13:15 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style license that can be | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #ifndef REMOTING_HOST_HOST_EXTENSION_H_ | ||||
6 | #define REMOTING_HOST_HOST_EXTENSION_H_ | ||||
7 | |||||
dcheng | 0765c49 | 2016-04-06 22:41:53 | [diff] [blame] | 8 | #include <memory> |
[email protected] | 399b4f6 | 2014-05-30 20:13:15 | [diff] [blame] | 9 | #include <string> |
10 | |||||
[email protected] | 399b4f6 | 2014-05-30 20:13:15 | [diff] [blame] | 11 | namespace remoting { |
12 | |||||
joedow | 4fa09d9 | 2016-06-27 21:26:17 | [diff] [blame] | 13 | class ClientSessionDetails; |
[email protected] | 399b4f6 | 2014-05-30 20:13:15 | [diff] [blame] | 14 | class HostExtensionSession; |
15 | |||||
[email protected] | 1b478ba | 2014-07-31 12:51:43 | [diff] [blame] | 16 | namespace protocol { |
17 | class ClientStub; | ||||
18 | } | ||||
19 | |||||
[email protected] | 399b4f6 | 2014-05-30 20:13:15 | [diff] [blame] | 20 | // Extends |ChromotingHost| with new functionality, and can use extension |
21 | // messages to communicate with the client. | ||||
22 | class HostExtension { | ||||
23 | public: | ||||
24 | virtual ~HostExtension() {} | ||||
25 | |||||
[email protected] | 1b478ba | 2014-07-31 12:51:43 | [diff] [blame] | 26 | // Returns the name of the capability for this extension. This is merged into |
27 | // the capabilities the host reports to the client, to determine whether a | ||||
28 | // HostExtensionSession should be created for a particular session. | ||||
29 | // Returning an empty string indicates that the extension is not associated | ||||
30 | // with a capability. | ||||
31 | virtual std::string capability() const = 0; | ||||
[email protected] | 399b4f6 | 2014-05-30 20:13:15 | [diff] [blame] | 32 | |
joedow | 4fa09d9 | 2016-06-27 21:26:17 | [diff] [blame] | 33 | // Creates an extension session, which handles extension messages for a |
[email protected] | 399b4f6 | 2014-05-30 20:13:15 | [diff] [blame] | 34 | // client session. |
joedow | 4fa09d9 | 2016-06-27 21:26:17 | [diff] [blame] | 35 | // |client_session_details| provides session details and control methods. |
[email protected] | 1b478ba | 2014-07-31 12:51:43 | [diff] [blame] | 36 | // |client_stub| may be used to send messages to the session. |
37 | // Both interfaces are valid for the lifetime of the |HostExtensionSession|. | ||||
dcheng | 0765c49 | 2016-04-06 22:41:53 | [diff] [blame] | 38 | virtual std::unique_ptr<HostExtensionSession> CreateExtensionSession( |
joedow | 4fa09d9 | 2016-06-27 21:26:17 | [diff] [blame] | 39 | ClientSessionDetails* client_session_details, |
[email protected] | 1b478ba | 2014-07-31 12:51:43 | [diff] [blame] | 40 | protocol::ClientStub* client_stub) = 0; |
[email protected] | 399b4f6 | 2014-05-30 20:13:15 | [diff] [blame] | 41 | }; |
42 | |||||
43 | } // namespace remoting | ||||
44 | |||||
45 | #endif // REMOTING_HOST_HOST_EXTENSION_H_ |