Home | History | Annotate | Download | only in host
      1 // Copyright (c) 2012 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_STATUS_OBSERVER_H_
      6 #define REMOTING_HOST_HOST_STATUS_OBSERVER_H_
      7 
      8 #include <string>
      9 
     10 #include "third_party/skia/include/core/SkRect.h"
     11 
     12 namespace net {
     13 class IPEndPoint;
     14 }  // namespace net
     15 
     16 namespace remoting {
     17 class SignalStrategy;
     18 
     19 namespace protocol {
     20 struct TransportRoute;
     21 };
     22 
     23 // Interface for host status observer. All methods are invoked on the
     24 // network thread. Observers must not tear-down ChromotingHost state
     25 // on receipt of these callbacks; they are purely informational.
     26 class HostStatusObserver {
     27  public:
     28   HostStatusObserver() { }
     29   virtual ~HostStatusObserver() { }
     30 
     31   // Called when an unauthorized user attempts to connect to the host.
     32   virtual void OnAccessDenied(const std::string& jid) {}
     33 
     34   // A new client is authenticated.
     35   virtual void OnClientAuthenticated(const std::string& jid) {}
     36 
     37   // All channels for an autheticated client are connected.
     38   virtual void OnClientConnected(const std::string& jid) {}
     39 
     40   // An authenticated client is disconnected.
     41   virtual void OnClientDisconnected(const std::string& jid) {}
     42 
     43   // Called on notification of a route change event, when a channel is
     44   // connected.
     45   virtual void OnClientRouteChange(const std::string& jid,
     46                                    const std::string& channel_name,
     47                                    const protocol::TransportRoute& route) {}
     48 
     49   // Called when hosting is started for an account.
     50   virtual void OnStart(const std::string& xmpp_login) {}
     51 
     52   // Called when the host shuts down.
     53   virtual void OnShutdown() {}
     54 };
     55 
     56 }  // namespace remoting
     57 
     58 #endif  // REMOTING_HOST_HOST_STATUS_OBSERVER_H_
     59