host_extension.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #ifndef REMOTING_HOST_HOST_EXTENSION_H_
  5. #define REMOTING_HOST_HOST_EXTENSION_H_
  6. #include <memory>
  7. #include <string>
  8. namespace remoting {
  9. class ClientSessionDetails;
  10. class HostExtensionSession;
  11. namespace protocol {
  12. class ClientStub;
  13. }
  14. // Extends |ChromotingHost| with new functionality, and can use extension
  15. // messages to communicate with the client.
  16. class HostExtension {
  17. public:
  18. virtual ~HostExtension() {}
  19. // Returns the name of the capability for this extension. This is merged into
  20. // the capabilities the host reports to the client, to determine whether a
  21. // HostExtensionSession should be created for a particular session.
  22. // Returning an empty string indicates that the extension is not associated
  23. // with a capability.
  24. virtual std::string capability() const = 0;
  25. // Creates an extension session, which handles extension messages for a
  26. // client session.
  27. // |client_session_details| provides session details and control methods.
  28. // |client_stub| may be used to send messages to the session.
  29. // Both interfaces are valid for the lifetime of the |HostExtensionSession|.
  30. virtual std::unique_ptr<HostExtensionSession> CreateExtensionSession(
  31. ClientSessionDetails* client_session_details,
  32. protocol::ClientStub* client_stub) = 0;
  33. };
  34. } // namespace remoting
  35. #endif // REMOTING_HOST_HOST_EXTENSION_H_