OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_SERVICE_REMOTING_CHROMOTING_HOST_MANAGER_H_ | |
6 #define CHROME_SERVICE_REMOTING_CHROMOTING_HOST_MANAGER_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/ref_counted.h" | |
11 #include "base/scoped_ptr.h" | |
12 #include "remoting/host/chromoting_host.h" | |
13 #include "remoting/host/chromoting_host_context.h" | |
14 #include "remoting/host/host_config.h" | |
15 | |
16 namespace base { | |
17 class MessageLoopProxy; | |
18 } // namespace base | |
19 | |
20 namespace remoting { | |
21 | |
22 struct ChromotingHostInfo; | |
23 | |
24 class ChromotingHostManager | |
Alpha Left Google
2010/12/16 21:32:44
Comments here about what this class is doing.
Sergey Ulanov
2010/12/17 00:05:43
Done.
| |
25 : public base::RefCountedThreadSafe<ChromotingHostManager> { | |
26 public: | |
27 class Observer { | |
Alpha Left Google
2010/12/16 21:32:44
Also comments here.
Sergey Ulanov
2010/12/17 00:05:43
Done.
| |
28 public: | |
29 virtual ~Observer() {} | |
30 virtual void OnChromotingHostEnabled() {} | |
31 virtual void OnChromotingHostDisabled() {} | |
32 }; | |
33 | |
34 ChromotingHostManager(Observer* observer); | |
35 | |
36 void Initialize(base::MessageLoopProxy* file_message_loop); | |
37 void Teardown(); | |
38 | |
39 // Return the reference to the chromoting host only if it has started. | |
40 remoting::ChromotingHost* GetChromotingHost() { return chromoting_host_; } | |
41 | |
42 // Updates credentials used for XMPP connection. | |
43 void SetCredentials(const std::string& login, const std::string& token); | |
44 | |
45 bool IsEnabled(); | |
46 | |
47 // Start running the chromoting host asynchronously. | |
48 void Enable(); | |
49 | |
50 // Stop chromoting host. The shutdown process will happen asynchronously. | |
51 void Disable(); | |
52 | |
53 void GetHostInfo(ChromotingHostInfo* host_info); | |
54 | |
55 private: | |
56 bool IsConfigInitialized(); | |
57 void InitializeConfig(); | |
58 | |
59 void SetEnabled(bool enabled); | |
60 void Start(); | |
61 void Stop(); | |
62 | |
63 void OnShutdown(); | |
64 | |
65 Observer* observer_; | |
66 | |
67 scoped_refptr<remoting::MutableHostConfig> chromoting_config_; | |
68 scoped_ptr<remoting::ChromotingHostContext> chromoting_context_; | |
69 scoped_refptr<remoting::ChromotingHost> chromoting_host_; | |
70 }; | |
71 | |
72 } // namespace remoting | |
73 | |
74 #endif // CHROME_SERVICE_REMOTING_CHROMOTING_HOST_MANAGER_H_ | |
OLD | NEW |