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