1cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved.
2cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
3cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// found in the LICENSE file.
4cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
5cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#ifndef REMOTING_HOST_HOST_EXTENSION_H_
6cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#define REMOTING_HOST_HOST_EXTENSION_H_
7cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
8cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#include <string>
9cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
10cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#include "base/memory/scoped_ptr.h"
11cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
12cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)namespace remoting {
13cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
145f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)class ClientSessionControl;
15cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)class HostExtensionSession;
16cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
175f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)namespace protocol {
185f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)class ClientStub;
195f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)}
205f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
21cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// Extends |ChromotingHost| with new functionality, and can use extension
22cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// messages to communicate with the client.
23cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)class HostExtension {
24cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) public:
25cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  virtual ~HostExtension() {}
26cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
275f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  // Returns the name of the capability for this extension. This is merged into
285f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  // the capabilities the host reports to the client, to determine whether a
295f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  // HostExtensionSession should be created for a particular session.
305f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  // Returning an empty string indicates that the extension is not associated
315f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  // with a capability.
325f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  virtual std::string capability() const = 0;
33cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
34cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  // Creates an extension session, which can handle extension messages for a
35cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  // client session.
365f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  // |client_session_control| may be used to e.g. disconnect the session.
375f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  // |client_stub| may be used to send messages to the session.
385f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  // Both interfaces are valid for the lifetime of the |HostExtensionSession|.
39cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  virtual scoped_ptr<HostExtensionSession> CreateExtensionSession(
405f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)      ClientSessionControl* client_session_control,
415f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)      protocol::ClientStub* client_stub) = 0;
42cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)};
43cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
44cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)}  // namespace remoting
45cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
46cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#endif  // REMOTING_HOST_HOST_EXTENSION_H_
47