OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_SERVICE_REMOTING_CHROMOTING_HOST_MANAGER_H_ | 5 #ifndef CHROME_SERVICE_REMOTING_CHROMOTING_HOST_MANAGER_H_ |
6 #define CHROME_SERVICE_REMOTING_CHROMOTING_HOST_MANAGER_H_ | 6 #define CHROME_SERVICE_REMOTING_CHROMOTING_HOST_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 public: | 34 public: |
35 virtual ~Observer() {} | 35 virtual ~Observer() {} |
36 virtual void OnChromotingHostEnabled() = 0; | 36 virtual void OnChromotingHostEnabled() = 0; |
37 virtual void OnChromotingHostDisabled() = 0; | 37 virtual void OnChromotingHostDisabled() = 0; |
38 }; | 38 }; |
39 | 39 |
40 // Caller keeps ownership of |observer|. |observer| must not be | 40 // Caller keeps ownership of |observer|. |observer| must not be |
41 // destroyed while this object exists. | 41 // destroyed while this object exists. |
42 explicit ChromotingHostManager(Observer* observer); | 42 explicit ChromotingHostManager(Observer* observer); |
43 | 43 |
44 void Initialize(MessageLoop* main_message_loop, | 44 void Initialize(MessageLoopForUI* main_message_loop, |
45 base::MessageLoopProxy* file_message_loop); | 45 base::MessageLoopProxy* file_message_loop); |
46 | 46 |
47 // Shutdown ChromotingHostManager. |done_task| will be executed when done. | 47 // Shutdown ChromotingHostManager. |done_task| will be executed when done. |
48 // This method must be called before ChromotingHostManager is destroyed. | 48 // This method must be called before ChromotingHostManager is destroyed. |
49 void Teardown(Task* done_task); | 49 void Teardown(Task* done_task); |
50 | 50 |
51 // Return the reference to the chromoting host only if it has started. | 51 // Return the reference to the chromoting host only if it has started. |
52 remoting::ChromotingHost* GetChromotingHost() { return chromoting_host_; } | 52 remoting::ChromotingHost* GetChromotingHost() { return chromoting_host_; } |
53 | 53 |
54 // Updates credentials used for XMPP connection. | 54 // Updates credentials used for XMPP connection. |
(...skipping 21 matching lines...) Expand all Loading... |
76 void Stop(Task* done_task); | 76 void Stop(Task* done_task); |
77 | 77 |
78 void OnShutdown(); | 78 void OnShutdown(); |
79 | 79 |
80 Observer* observer_; | 80 Observer* observer_; |
81 | 81 |
82 scoped_refptr<remoting::MutableHostConfig> chromoting_config_; | 82 scoped_refptr<remoting::MutableHostConfig> chromoting_config_; |
83 scoped_ptr<remoting::ChromotingHostContext> chromoting_context_; | 83 scoped_ptr<remoting::ChromotingHostContext> chromoting_context_; |
84 scoped_refptr<remoting::ChromotingHost> chromoting_host_; | 84 scoped_refptr<remoting::ChromotingHost> chromoting_host_; |
85 | 85 |
86 MessageLoop* main_message_loop_; | 86 MessageLoopForUI* main_message_loop_; |
87 scoped_ptr<Task> shutdown_task_; | 87 scoped_ptr<Task> shutdown_task_; |
88 }; | 88 }; |
89 | 89 |
90 } // namespace remoting | 90 } // namespace remoting |
91 | 91 |
92 #endif // CHROME_SERVICE_REMOTING_CHROMOTING_HOST_MANAGER_H_ | 92 #endif // CHROME_SERVICE_REMOTING_CHROMOTING_HOST_MANAGER_H_ |
OLD | NEW |