| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_STATUS_OBSERVER_H_ | 5 #ifndef REMOTING_HOST_HOST_STATUS_OBSERVER_H_ |
| 6 #define REMOTING_HOST_STATUS_OBSERVER_H_ | 6 #define REMOTING_HOST_HOST_STATUS_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 namespace remoting { | 10 namespace remoting { |
| 11 class SignalStrategy; | 11 class SignalStrategy; |
| 12 | 12 |
| 13 namespace protocol { | |
| 14 class ConnectionToClient; | |
| 15 } | |
| 16 | |
| 17 // Interface for host status observer. All methods are invoked on the | 13 // Interface for host status observer. All methods are invoked on the |
| 18 // network thread. | 14 // network thread. |
| 19 class HostStatusObserver { | 15 class HostStatusObserver { |
| 20 public: | 16 public: |
| 21 HostStatusObserver() { } | 17 HostStatusObserver() { } |
| 22 virtual ~HostStatusObserver() { } | 18 virtual ~HostStatusObserver() { } |
| 23 | 19 |
| 24 // Called when status of the signalling channel changes. | 20 // Called when status of the signalling channel changes. |
| 25 virtual void OnSignallingConnected(SignalStrategy* signal_strategy, | 21 virtual void OnSignallingConnected(SignalStrategy* signal_strategy, |
| 26 const std::string& full_jid) = 0; | 22 const std::string& full_jid) = 0; |
| 27 virtual void OnSignallingDisconnected() = 0; | 23 virtual void OnSignallingDisconnected() = 0; |
| 28 | 24 |
| 29 // Called when an unauthorized user attempts to connect to the host. | 25 // Called when an unauthorized user attempts to connect to the host. |
| 30 virtual void OnAccessDenied() = 0; | 26 virtual void OnAccessDenied() = 0; |
| 31 | 27 |
| 32 // Called when a client authenticates, or disconnects. Observers | 28 // Called when a client authenticates, or disconnects. Observers |
| 33 // must not tear-down ChromotingHost state on receipt of this | 29 // must not tear-down ChromotingHost state on receipt of this |
| 34 // callback; it is purely informational. | 30 // callback; it is purely informational. |
| 35 virtual void OnClientAuthenticated(const std::string& jid) = 0; | 31 virtual void OnClientAuthenticated(const std::string& jid) = 0; |
| 36 virtual void OnClientDisconnected(const std::string& jid) = 0; | 32 virtual void OnClientDisconnected(const std::string& jid) = 0; |
| 37 | 33 |
| 38 // Called when the host shuts down. | 34 // Called when the host shuts down. |
| 39 virtual void OnShutdown() = 0; | 35 virtual void OnShutdown() = 0; |
| 40 }; | 36 }; |
| 41 | 37 |
| 42 } // namespace remoting | 38 } // namespace remoting |
| 43 | 39 |
| 44 #endif // REMOTING_HOST_STATUS_OBSERVER_H_ | 40 #endif // REMOTING_HOST_HOST_STATUS_OBSERVER_H_ |
| OLD | NEW |