host_status_observer.h 1.63 KB
Newer Older
1
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 3 4
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5 6
#ifndef REMOTING_HOST_HOST_STATUS_OBSERVER_H_
#define REMOTING_HOST_HOST_STATUS_OBSERVER_H_
7

8 9
#include <string>

10 11
namespace remoting {

12 13 14 15
namespace protocol {
struct TransportRoute;
};

16
// Interface for host status observer. All methods are invoked on the
17 18
// network thread. Observers must not tear-down ChromotingHost state
// on receipt of these callbacks; they are purely informational.
19
class HostStatusObserver {
20 21
 public:
  HostStatusObserver() { }
22
  virtual ~HostStatusObserver() { }
23

24
  // Called when an unauthorized user attempts to connect to the host.
25
  virtual void OnAccessDenied(const std::string& jid) {}
26

27 28 29 30 31 32 33 34
  // A new client is authenticated.
  virtual void OnClientAuthenticated(const std::string& jid) {}

  // All channels for an autheticated client are connected.
  virtual void OnClientConnected(const std::string& jid) {}

  // An authenticated client is disconnected.
  virtual void OnClientDisconnected(const std::string& jid) {}
35

36 37
  // Called on notification of a route change event, when a channel is
  // connected.
38 39
  virtual void OnClientRouteChange(const std::string& jid,
                                   const std::string& channel_name,
40
                                   const protocol::TransportRoute& route) {}
41

42
  // Called when hosting is started for an account.
43
  virtual void OnStart(const std::string& host_owner_email) {}
44

45
  // Called when the host shuts down.
46
  virtual void OnShutdown() {}
47 48 49 50
};

}  // namespace remoting

51
#endif  // REMOTING_HOST_HOST_STATUS_OBSERVER_H_