host_status_observer.h revision 5821806d5e7f356e8fa4b058a389a808ea183019
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 12namespace net { 13class IPEndPoint; 14} // namespace net 15 16namespace remoting { 17class SignalStrategy; 18 19namespace protocol { 20struct 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. 26class 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 the client view dimensions change. 50 virtual void OnClientDimensionsChanged(const std::string& jid, 51 const SkISize& size) {} 52 53 // Called when hosting is started for an account. 54 virtual void OnStart(const std::string& xmpp_login) {} 55 56 // Called when the host shuts down. 57 virtual void OnShutdown() {} 58}; 59 60} // namespace remoting 61 62#endif // REMOTING_HOST_HOST_STATUS_OBSERVER_H_ 63