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 8 #include <string> 9 10 #include "base/memory/scoped_ptr.h" 11 12 namespace remoting { 13 14 class ClientSessionControl; 15 class HostExtensionSession; 16 17 namespace protocol { 18 class ClientStub; 19 } 20 21 // Extends |ChromotingHost| with new functionality, and can use extension 22 // messages to communicate with the client. 23 class HostExtension { 24 public: 25 virtual ~HostExtension() {} 26 27 // Returns the name of the capability for this extension. This is merged into 28 // the capabilities the host reports to the client, to determine whether a 29 // HostExtensionSession should be created for a particular session. 30 // Returning an empty string indicates that the extension is not associated 31 // with a capability. 32 virtual std::string capability() const = 0; 33 34 // Creates an extension session, which can handle extension messages for a 35 // client session. 36 // |client_session_control| may be used to e.g. disconnect the session. 37 // |client_stub| may be used to send messages to the session. 38 // Both interfaces are valid for the lifetime of the |HostExtensionSession|. 39 virtual scoped_ptr<HostExtensionSession> CreateExtensionSession( 40 ClientSessionControl* client_session_control, 41 protocol::ClientStub* client_stub) = 0; 42 }; 43 44 } // namespace remoting 45 46 #endif // REMOTING_HOST_HOST_EXTENSION_H_ 47