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_CURTAINING_HOST_OBSERVER_H_ | 5 #ifndef REMOTING_HOST_CURTAINING_HOST_OBSERVER_H_ |
6 #define REMOTING_HOST_CURTAINING_HOST_OBSERVER_H_ | 6 #define REMOTING_HOST_CURTAINING_HOST_OBSERVER_H_ |
7 | 7 |
8 #include <set> | |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
14 #include "remoting/host/host_status_observer.h" | 15 #include "remoting/host/host_status_observer.h" |
15 | 16 |
16 namespace remoting { | 17 namespace remoting { |
17 | 18 |
18 class CurtainMode; | 19 class CurtainMode; |
19 class ChromotingHost; | 20 class ChromotingHost; |
20 | 21 |
21 class CurtainingHostObserver : public HostStatusObserver { | 22 class CurtainingHostObserver : public HostStatusObserver { |
22 public: | 23 public: |
23 CurtainingHostObserver(CurtainMode *curtain, | 24 CurtainingHostObserver(CurtainMode *curtain, |
24 scoped_refptr<ChromotingHost> host); | 25 scoped_refptr<ChromotingHost> host); |
25 virtual ~CurtainingHostObserver(); | 26 virtual ~CurtainingHostObserver(); |
26 | 27 |
27 // From HostStatusObserver. | 28 // Enables/disabled curtaining when one or more clients are connected. |
Jamie
2012/11/07 00:27:49
Nit: s/disabled/disables/
Wez
2012/11/07 02:37:32
Done.
| |
29 // Takes immediate effect if clients are already connected. | |
30 void SetEnableCurtaining(bool enable); | |
Jamie
2012/11/07 00:27:49
Check with Renato, or see his previous CL around c
rmsousa
2012/11/07 00:33:25
Having it here is fine, as long as there's another
| |
31 | |
32 // HostStatusObserver interface. | |
28 virtual void OnClientAuthenticated(const std::string& jid) OVERRIDE; | 33 virtual void OnClientAuthenticated(const std::string& jid) OVERRIDE; |
29 virtual void OnClientDisconnected(const std::string& jid) OVERRIDE; | 34 virtual void OnClientDisconnected(const std::string& jid) OVERRIDE; |
30 | 35 |
31 private: | 36 private: |
32 CurtainMode* curtain_; | 37 CurtainMode* curtain_; |
33 scoped_refptr<ChromotingHost> host_; | 38 scoped_refptr<ChromotingHost> host_; |
39 std::set<std::string> active_clients_; | |
40 bool enable_curtaining_; | |
34 }; | 41 }; |
35 | 42 |
36 } // namespace remoting | 43 } // namespace remoting |
37 #endif | 44 #endif |
OLD | NEW |