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_CHROMOTING_HOST_H_ | 5 #ifndef REMOTING_CHROMOTING_HOST_H_ |
6 #define REMOTING_CHROMOTING_HOST_H_ | 6 #define REMOTING_CHROMOTING_HOST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/threading/thread.h" | 11 #include "base/threading/thread.h" |
12 #include "base/timer.h" | |
13 #include "remoting/base/encoder.h" | 12 #include "remoting/base/encoder.h" |
14 #include "remoting/host/access_verifier.h" | 13 #include "remoting/host/access_verifier.h" |
15 #include "remoting/host/capturer.h" | 14 #include "remoting/host/capturer.h" |
16 #include "remoting/host/client_session.h" | 15 #include "remoting/host/client_session.h" |
17 #include "remoting/host/desktop_environment.h" | 16 #include "remoting/host/desktop_environment.h" |
18 #include "remoting/host/host_status_observer.h" | 17 #include "remoting/host/host_status_observer.h" |
19 #include "remoting/jingle_glue/jingle_thread.h" | 18 #include "remoting/jingle_glue/jingle_thread.h" |
20 #include "remoting/jingle_glue/signal_strategy.h" | 19 #include "remoting/jingle_glue/signal_strategy.h" |
21 #include "remoting/protocol/session_manager.h" | 20 #include "remoting/protocol/session_manager.h" |
22 #include "remoting/protocol/connection_to_client.h" | 21 #include "remoting/protocol/connection_to_client.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
168 | 167 |
169 // Creates encoder for the specified configuration. | 168 // Creates encoder for the specified configuration. |
170 Encoder* CreateEncoder(const protocol::SessionConfig* config); | 169 Encoder* CreateEncoder(const protocol::SessionConfig* config); |
171 | 170 |
172 std::string GenerateHostAuthToken(const std::string& encoded_client_token); | 171 std::string GenerateHostAuthToken(const std::string& encoded_client_token); |
173 | 172 |
174 int AuthenticatedClientsCount() const; | 173 int AuthenticatedClientsCount() const; |
175 | 174 |
176 void EnableCurtainMode(bool enable); | 175 void EnableCurtainMode(bool enable); |
177 | 176 |
178 void MonitorLocalInputs(bool enable); | |
179 | |
180 void ProcessPreAuthentication( | 177 void ProcessPreAuthentication( |
181 const scoped_refptr<protocol::ConnectionToClient>& connection); | 178 const scoped_refptr<protocol::ConnectionToClient>& connection); |
182 | 179 |
183 // Show or hide the Disconnect window on the UI thread. If |show| is false, | |
184 // hide the window, ignoring the |username| parameter. | |
185 void ShowDisconnectWindow(bool show, const std::string& username); | |
186 | |
187 // Show or hide the Continue Sharing window on the UI thread. | |
188 void ShowContinueWindow(bool show); | |
189 | |
190 void StartContinueWindowTimer(bool start); | |
191 | |
192 void ContinueWindowTimerFunc(); | |
193 | |
194 // The following methods are called during shutdown. | 180 // The following methods are called during shutdown. |
195 void ShutdownRecorder(); | 181 void ShutdownRecorder(); |
196 void ShutdownFinish(); | 182 void ShutdownFinish(); |
197 | 183 |
198 // The context that the chromoting host runs on. | 184 // The context that the chromoting host runs on. |
199 ChromotingHostContext* context_; | 185 ChromotingHostContext* context_; |
200 | 186 |
201 scoped_refptr<MutableHostConfig> config_; | 187 scoped_refptr<MutableHostConfig> config_; |
202 | 188 |
203 scoped_ptr<DesktopEnvironment> desktop_environment_; | 189 scoped_ptr<DesktopEnvironment> desktop_environment_; |
Sergey Ulanov
2011/07/07 00:33:17
scoped_refptr?
garykac
2011/07/07 20:38:09
not needed (I removed refcounting).
| |
204 | 190 |
205 scoped_ptr<SignalStrategy> signal_strategy_; | 191 scoped_ptr<SignalStrategy> signal_strategy_; |
206 | 192 |
207 std::string local_jid_; | 193 std::string local_jid_; |
208 | 194 |
209 scoped_ptr<protocol::SessionManager> session_manager_; | 195 scoped_ptr<protocol::SessionManager> session_manager_; |
210 | 196 |
211 StatusObserverList status_observers_; | 197 StatusObserverList status_observers_; |
212 | 198 |
213 scoped_ptr<AccessVerifier> access_verifier_; | 199 scoped_ptr<AccessVerifier> access_verifier_; |
214 | 200 |
215 // The connections to remote clients. | 201 // The connections to remote clients. |
216 ClientList clients_; | 202 ClientList clients_; |
217 | 203 |
218 // Session manager for the host process. | 204 // Session manager for the host process. |
219 scoped_refptr<ScreenRecorder> recorder_; | 205 scoped_refptr<ScreenRecorder> recorder_; |
220 | 206 |
221 // Tracks the internal state of the host. | 207 // Tracks the internal state of the host. |
222 // This variable is written on the main thread of ChromotingHostContext | 208 // This variable is written on the main thread of ChromotingHostContext |
223 // and read by jingle thread. | 209 // and read by jingle thread. |
224 State state_; | 210 State state_; |
225 | 211 |
226 // Lock is to lock the access to |state_|. | 212 // Lock is to lock the access to |state_|. |
227 base::Lock lock_; | 213 base::Lock lock_; |
228 | 214 |
229 // Configuration of the protocol. | 215 // Configuration of the protocol. |
230 scoped_ptr<protocol::CandidateSessionConfig> protocol_config_; | 216 scoped_ptr<protocol::CandidateSessionConfig> protocol_config_; |
231 | 217 |
232 bool is_curtained_; | 218 bool is_curtained_; |
233 bool is_monitoring_local_inputs_; | |
234 | |
235 // Timer controlling the "continue session" dialog. The timer is started when | |
236 // a connection is made or re-confirmed. On expiry, inputs to the host are | |
237 // blocked and the dialog is shown. | |
238 base::OneShotTimer<ChromotingHost> continue_window_timer_; | |
239 | 219 |
240 // Whether or not the host is running in "IT2Me" mode, in which connections | 220 // Whether or not the host is running in "IT2Me" mode, in which connections |
241 // are pre-authenticated, and hence the local login challenge can be bypassed. | 221 // are pre-authenticated, and hence the local login challenge can be bypassed. |
242 bool is_it2me_; | 222 bool is_it2me_; |
243 | 223 |
244 // Stores list of tasks that should be executed when we finish | 224 // Stores list of tasks that should be executed when we finish |
245 // shutdown. Used only while |state_| is set to kStopping. | 225 // shutdown. Used only while |state_| is set to kStopping. |
246 std::vector<Task*> shutdown_tasks_; | 226 std::vector<Task*> shutdown_tasks_; |
247 | 227 |
248 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); | 228 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); |
249 }; | 229 }; |
250 | 230 |
251 } // namespace remoting | 231 } // namespace remoting |
252 | 232 |
253 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ | 233 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ |
OLD | NEW |