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. | |
21 virtual void OnSignallingConnected(SignalStrategy* signal_strategy) = 0; | |
22 virtual void OnSignallingDisconnected() = 0; | |
23 | |
24 // Called when an unauthorized user attempts to connect to the host. | 20 // Called when an unauthorized user attempts to connect to the host. |
25 virtual void OnAccessDenied() = 0; | 21 virtual void OnAccessDenied() = 0; |
26 | 22 |
27 // Called when a client authenticates, or disconnects. Observers | 23 // Called when a client authenticates, or disconnects. Observers |
28 // must not tear-down ChromotingHost state on receipt of this | 24 // must not tear-down ChromotingHost state on receipt of this |
29 // callback; it is purely informational. | 25 // callback; it is purely informational. |
30 virtual void OnClientAuthenticated(const std::string& jid) = 0; | 26 virtual void OnClientAuthenticated(const std::string& jid) = 0; |
31 virtual void OnClientDisconnected(const std::string& jid) = 0; | 27 virtual void OnClientDisconnected(const std::string& jid) = 0; |
32 | 28 |
33 // Called when the host shuts down. | 29 // Called when the host shuts down. |
34 virtual void OnShutdown() = 0; | 30 virtual void OnShutdown() = 0; |
35 }; | 31 }; |
36 | 32 |
37 } // namespace remoting | 33 } // namespace remoting |
38 | 34 |
39 #endif // REMOTING_HOST_HOST_STATUS_OBSERVER_H_ | 35 #endif // REMOTING_HOST_HOST_STATUS_OBSERVER_H_ |
OLD | NEW |