| 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 ShutdownNetwork(); | 181 void ShutdownNetwork(); |
| 196 void ShutdownRecorder(); | 182 void ShutdownRecorder(); |
| 197 void ShutdownFinish(); | 183 void ShutdownFinish(); |
| 198 | 184 |
| 199 // The context that the chromoting host runs on. | 185 // The context that the chromoting host runs on. |
| 200 ChromotingHostContext* context_; | 186 ChromotingHostContext* context_; |
| 201 | 187 |
| 202 scoped_refptr<MutableHostConfig> config_; | 188 scoped_refptr<MutableHostConfig> config_; |
| 203 | 189 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 224 // and read by jingle thread. | 210 // and read by jingle thread. |
| 225 State state_; | 211 State state_; |
| 226 | 212 |
| 227 // Lock is to lock the access to |state_|. | 213 // Lock is to lock the access to |state_|. |
| 228 base::Lock lock_; | 214 base::Lock lock_; |
| 229 | 215 |
| 230 // Configuration of the protocol. | 216 // Configuration of the protocol. |
| 231 scoped_ptr<protocol::CandidateSessionConfig> protocol_config_; | 217 scoped_ptr<protocol::CandidateSessionConfig> protocol_config_; |
| 232 | 218 |
| 233 bool is_curtained_; | 219 bool is_curtained_; |
| 234 bool is_monitoring_local_inputs_; | |
| 235 | |
| 236 // Timer controlling the "continue session" dialog. The timer is started when | |
| 237 // a connection is made or re-confirmed. On expiry, inputs to the host are | |
| 238 // blocked and the dialog is shown. | |
| 239 base::OneShotTimer<ChromotingHost> continue_window_timer_; | |
| 240 | 220 |
| 241 // Whether or not the host is running in "IT2Me" mode, in which connections | 221 // Whether or not the host is running in "IT2Me" mode, in which connections |
| 242 // are pre-authenticated, and hence the local login challenge can be bypassed. | 222 // are pre-authenticated, and hence the local login challenge can be bypassed. |
| 243 bool is_it2me_; | 223 bool is_it2me_; |
| 244 | 224 |
| 245 // Stores list of tasks that should be executed when we finish | 225 // Stores list of tasks that should be executed when we finish |
| 246 // shutdown. Used only while |state_| is set to kStopping. | 226 // shutdown. Used only while |state_| is set to kStopping. |
| 247 std::vector<Task*> shutdown_tasks_; | 227 std::vector<Task*> shutdown_tasks_; |
| 248 | 228 |
| 249 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); | 229 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); |
| 250 }; | 230 }; |
| 251 | 231 |
| 252 } // namespace remoting | 232 } // namespace remoting |
| 253 | 233 |
| 254 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ | 234 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ |
| OLD | NEW |