| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_HOST_HOST_STATUS_OBSERVER_H_ | 5 #ifndef REMOTING_HOST_HOST_STATUS_OBSERVER_H_ |
| 6 #define REMOTING_HOST_HOST_STATUS_OBSERVER_H_ | 6 #define REMOTING_HOST_HOST_STATUS_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 namespace net { | 10 namespace net { |
| 11 class IPEndPoint; | 11 class IPEndPoint; |
| 12 } // namespace net | 12 } // namespace net |
| 13 | 13 |
| 14 namespace remoting { | 14 namespace remoting { |
| 15 class SignalStrategy; | 15 class SignalStrategy; |
| 16 | 16 |
| 17 namespace protocol { | 17 namespace protocol { |
| 18 struct TransportRoute; | 18 struct TransportRoute; |
| 19 }; | 19 }; |
| 20 | 20 |
| 21 // Interface for host status observer. All methods are invoked on the | 21 // Interface for host status observer. All methods are invoked on the |
| 22 // network thread. Observers must not tear-down ChromotingHost state | 22 // network thread. Observers must not tear-down ChromotingHost state |
| 23 // on receipt of these callbacks; they are purely informational. | 23 // on receipt of these callbacks; they are purely informational. |
| 24 class HostStatusObserver { | 24 class HostStatusObserver { |
| 25 public: | 25 public: |
| 26 HostStatusObserver() { } | |
| 27 virtual ~HostStatusObserver() { } | 26 virtual ~HostStatusObserver() { } |
| 28 | 27 |
| 29 // Called when an unauthorized user attempts to connect to the host. | 28 // Called when an unauthorized user attempts to connect to the host. |
| 30 virtual void OnAccessDenied(const std::string& jid) {} | 29 virtual void OnAccessDenied(const std::string& jid) {} |
| 31 | 30 |
| 32 // A new client is authenticated. | 31 // A new client is authenticated. |
| 33 virtual void OnClientAuthenticated(const std::string& jid) {} | 32 virtual void OnClientAuthenticated(const std::string& jid) {} |
| 34 | 33 |
| 35 // All channels for an autheticated client are connected. | 34 // All channels for an autheticated client are connected. |
| 36 virtual void OnClientConnected(const std::string& jid) {} | 35 virtual void OnClientConnected(const std::string& jid) {} |
| 37 | 36 |
| 38 // An authenticated client is disconnected. | 37 // An authenticated client is disconnected. |
| 39 virtual void OnClientDisconnected(const std::string& jid) {} | 38 virtual void OnClientDisconnected(const std::string& jid) {} |
| 40 | 39 |
| 41 // Called on notification of a route change event, when a channel is | 40 // Called on notification of a route change event, when a channel is |
| 42 // connected. | 41 // connected. |
| 43 virtual void OnClientRouteChange(const std::string& jid, | 42 virtual void OnClientRouteChange(const std::string& jid, |
| 44 const std::string& channel_name, | 43 const std::string& channel_name, |
| 45 const protocol::TransportRoute& route) {} | 44 const protocol::TransportRoute& route) {} |
| 46 | 45 |
| 47 // Called when hosting is started for an account. | 46 // Called when hosting is started for an account. |
| 48 virtual void OnStart(const std::string& host_owner_email) {} | 47 virtual void OnStart(const std::string& host_owner_email) {} |
| 49 | 48 |
| 50 // Called when the host shuts down. | 49 // Called when the host shuts down. |
| 51 virtual void OnShutdown() {} | 50 virtual void OnShutdown() {} |
| 51 |
| 52 protected: |
| 53 HostStatusObserver() {} |
| 52 }; | 54 }; |
| 53 | 55 |
| 54 } // namespace remoting | 56 } // namespace remoting |
| 55 | 57 |
| 56 #endif // REMOTING_HOST_HOST_STATUS_OBSERVER_H_ | 58 #endif // REMOTING_HOST_HOST_STATUS_OBSERVER_H_ |
| OLD | NEW |