| 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 #include "remoting/host/client_session.h" | 5 #include "remoting/host/client_session.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 disable_input_filter_(&mouse_clamping_filter_), | 61 disable_input_filter_(&mouse_clamping_filter_), |
| 62 disable_clipboard_filter_(clipboard_echo_filter_.host_filter()), | 62 disable_clipboard_filter_(clipboard_echo_filter_.host_filter()), |
| 63 client_clipboard_factory_(clipboard_echo_filter_.client_filter()), | 63 client_clipboard_factory_(clipboard_echo_filter_.client_filter()), |
| 64 max_duration_(max_duration), | 64 max_duration_(max_duration), |
| 65 pairing_registry_(pairing_registry), | 65 pairing_registry_(pairing_registry), |
| 66 // Note that |lossless_video_color_| defaults to true, but actually only | 66 // Note that |lossless_video_color_| defaults to true, but actually only |
| 67 // controls VP9 video stream color quality. | 67 // controls VP9 video stream color quality. |
| 68 lossless_video_color_(!base::CommandLine::ForCurrentProcess()->HasSwitch( | 68 lossless_video_color_(!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 69 kDisableI444SwitchName)), | 69 kDisableI444SwitchName)), |
| 70 weak_factory_(this) { | 70 weak_factory_(this) { |
| 71 connection_->session()->AddPlugin(&host_experiment_session_plugin_); |
| 71 connection_->SetEventHandler(this); | 72 connection_->SetEventHandler(this); |
| 72 | 73 |
| 73 // Create a manager for the configured extensions, if any. | 74 // Create a manager for the configured extensions, if any. |
| 74 extension_manager_.reset(new HostExtensionSessionManager(extensions, this)); | 75 extension_manager_.reset(new HostExtensionSessionManager(extensions, this)); |
| 75 | 76 |
| 76 #if defined(OS_WIN) | 77 #if defined(OS_WIN) |
| 77 // LocalInputMonitorWin filters out an echo of the injected input before it | 78 // LocalInputMonitorWin filters out an echo of the injected input before it |
| 78 // reaches |remote_input_filter_|. | 79 // reaches |remote_input_filter_|. |
| 79 remote_input_filter_.SetExpectLocalEcho(false); | 80 remote_input_filter_.SetExpectLocalEcho(false); |
| 80 #endif // defined(OS_WIN) | 81 #endif // defined(OS_WIN) |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 if (max_duration_ > base::TimeDelta()) { | 235 if (max_duration_ > base::TimeDelta()) { |
| 235 max_duration_timer_.Start( | 236 max_duration_timer_.Start( |
| 236 FROM_HERE, max_duration_, | 237 FROM_HERE, max_duration_, |
| 237 base::Bind(&ClientSession::DisconnectSession, base::Unretained(this), | 238 base::Bind(&ClientSession::DisconnectSession, base::Unretained(this), |
| 238 protocol::MAX_SESSION_LENGTH)); | 239 protocol::MAX_SESSION_LENGTH)); |
| 239 } | 240 } |
| 240 | 241 |
| 241 // Notify EventHandler. | 242 // Notify EventHandler. |
| 242 event_handler_->OnSessionAuthenticated(this); | 243 event_handler_->OnSessionAuthenticated(this); |
| 243 | 244 |
| 245 DesktopEnvironmentOptions options = desktop_environment_options_; |
| 246 options.ApplyHostSessionOptions(HostSessionOptions( |
| 247 host_experiment_session_plugin_.configuration())); |
| 244 // Create the desktop environment. Drop the connection if it could not be | 248 // Create the desktop environment. Drop the connection if it could not be |
| 245 // created for any reason (for instance the curtain could not initialize). | 249 // created for any reason (for instance the curtain could not initialize). |
| 246 desktop_environment_ = desktop_environment_factory_->Create( | 250 desktop_environment_ = |
| 247 weak_factory_.GetWeakPtr(), desktop_environment_options_); | 251 desktop_environment_factory_->Create(weak_factory_.GetWeakPtr(), options); |
| 248 if (!desktop_environment_) { | 252 if (!desktop_environment_) { |
| 249 DisconnectSession(protocol::HOST_CONFIGURATION_ERROR); | 253 DisconnectSession(protocol::HOST_CONFIGURATION_ERROR); |
| 250 return; | 254 return; |
| 251 } | 255 } |
| 252 | 256 |
| 253 // Connect host stub. | 257 // Connect host stub. |
| 254 connection_->set_host_stub(this); | 258 connection_->set_host_stub(this); |
| 255 | 259 |
| 256 // Collate the set of capabilities to offer the client, if it supports them. | 260 // Collate the set of capabilities to offer the client, if it supports them. |
| 257 host_capabilities_ = desktop_environment_->GetCapabilities(); | 261 host_capabilities_ = desktop_environment_->GetCapabilities(); |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 connection_->client_stub()->SetVideoLayout(layout); | 466 connection_->client_stub()->SetVideoLayout(layout); |
| 463 } else { | 467 } else { |
| 464 pending_video_layout_message_.reset(new protocol::VideoLayout(layout)); | 468 pending_video_layout_message_.reset(new protocol::VideoLayout(layout)); |
| 465 } | 469 } |
| 466 break; | 470 break; |
| 467 } | 471 } |
| 468 } | 472 } |
| 469 } | 473 } |
| 470 | 474 |
| 471 } // namespace remoting | 475 } // namespace remoting |
| OLD | NEW |