blob: 4fa6b3b20983f98b79cc2ff61b7fc6d1826925bf [file] [log] [blame]
[email protected]399b4f62014-05-30 20:13:151// 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
dcheng0765c492016-04-06 22:41:538#include <memory>
[email protected]399b4f62014-05-30 20:13:159#include <string>
10
[email protected]399b4f62014-05-30 20:13:1511namespace remoting {
12
joedow4fa09d92016-06-27 21:26:1713class ClientSessionDetails;
[email protected]399b4f62014-05-30 20:13:1514class HostExtensionSession;
15
[email protected]1b478ba2014-07-31 12:51:4316namespace protocol {
17class ClientStub;
18}
19
[email protected]399b4f62014-05-30 20:13:1520// Extends |ChromotingHost| with new functionality, and can use extension
21// messages to communicate with the client.
22class HostExtension {
23 public:
24 virtual ~HostExtension() {}
25
[email protected]1b478ba2014-07-31 12:51:4326 // 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]399b4f62014-05-30 20:13:1532
joedow4fa09d92016-06-27 21:26:1733 // Creates an extension session, which handles extension messages for a
[email protected]399b4f62014-05-30 20:13:1534 // client session.
joedow4fa09d92016-06-27 21:26:1735 // |client_session_details| provides session details and control methods.
[email protected]1b478ba2014-07-31 12:51:4336 // |client_stub| may be used to send messages to the session.
37 // Both interfaces are valid for the lifetime of the |HostExtensionSession|.
dcheng0765c492016-04-06 22:41:5338 virtual std::unique_ptr<HostExtensionSession> CreateExtensionSession(
joedow4fa09d92016-06-27 21:26:1739 ClientSessionDetails* client_session_details,
[email protected]1b478ba2014-07-31 12:51:4340 protocol::ClientStub* client_stub) = 0;
[email protected]399b4f62014-05-30 20:13:1541};
42
43} // namespace remoting
44
45#endif // REMOTING_HOST_HOST_EXTENSION_H_