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