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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 audio_task_runner_(audio_task_runner), | 81 audio_task_runner_(audio_task_runner), |
82 pairing_registry_(pairing_registry), | 82 pairing_registry_(pairing_registry), |
83 // Note that |lossless_video_color_| defaults to true, but actually only | 83 // Note that |lossless_video_color_| defaults to true, but actually only |
84 // controls VP9 video stream color quality. | 84 // controls VP9 video stream color quality. |
85 lossless_video_color_(!base::CommandLine::ForCurrentProcess()->HasSwitch( | 85 lossless_video_color_(!base::CommandLine::ForCurrentProcess()->HasSwitch( |
86 kDisableI444SwitchName)), | 86 kDisableI444SwitchName)), |
87 weak_factory_(this) { | 87 weak_factory_(this) { |
88 connection_->SetEventHandler(this); | 88 connection_->SetEventHandler(this); |
89 | 89 |
90 // Create a manager for the configured extensions, if any. | 90 // Create a manager for the configured extensions, if any. |
91 extension_manager_.reset(new HostExtensionSessionManager(extensions, this)); | 91 extension_manager_.reset( |
| 92 new HostExtensionSessionManager(extensions, this, this)); |
92 | 93 |
93 #if defined(OS_WIN) | 94 #if defined(OS_WIN) |
94 // LocalInputMonitorWin filters out an echo of the injected input before it | 95 // LocalInputMonitorWin filters out an echo of the injected input before it |
95 // reaches |remote_input_filter_|. | 96 // reaches |remote_input_filter_|. |
96 remote_input_filter_.SetExpectLocalEcho(false); | 97 remote_input_filter_.SetExpectLocalEcho(false); |
97 #endif // defined(OS_WIN) | 98 #endif // defined(OS_WIN) |
98 } | 99 } |
99 | 100 |
100 ClientSession::~ClientSession() { | 101 ClientSession::~ClientSession() { |
101 DCHECK(CalledOnValidThread()); | 102 DCHECK(CalledOnValidThread()); |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 void ClientSession::SetDisableInputs(bool disable_inputs) { | 419 void ClientSession::SetDisableInputs(bool disable_inputs) { |
419 DCHECK(CalledOnValidThread()); | 420 DCHECK(CalledOnValidThread()); |
420 | 421 |
421 if (disable_inputs) | 422 if (disable_inputs) |
422 input_tracker_.ReleaseAll(); | 423 input_tracker_.ReleaseAll(); |
423 | 424 |
424 disable_input_filter_.set_enabled(!disable_inputs); | 425 disable_input_filter_.set_enabled(!disable_inputs); |
425 disable_clipboard_filter_.set_enabled(!disable_inputs); | 426 disable_clipboard_filter_.set_enabled(!disable_inputs); |
426 } | 427 } |
427 | 428 |
| 429 uint32_t ClientSession::desktop_session_id() const { |
| 430 DCHECK(CalledOnValidThread()); |
| 431 return desktop_environment_ ? desktop_environment_->GetDesktopSessionId() |
| 432 : UINT32_MAX; |
| 433 } |
| 434 |
428 std::unique_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() { | 435 std::unique_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() { |
429 DCHECK(CalledOnValidThread()); | 436 DCHECK(CalledOnValidThread()); |
430 | 437 |
431 return base::WrapUnique( | 438 return base::WrapUnique( |
432 new protocol::ClipboardThreadProxy(client_clipboard_factory_.GetWeakPtr(), | 439 new protocol::ClipboardThreadProxy(client_clipboard_factory_.GetWeakPtr(), |
433 base::ThreadTaskRunnerHandle::Get())); | 440 base::ThreadTaskRunnerHandle::Get())); |
434 } | 441 } |
435 | 442 |
436 void ClientSession::OnVideoSizeChanged(protocol::VideoStream* video_stream, | 443 void ClientSession::OnVideoSizeChanged(protocol::VideoStream* video_stream, |
437 const webrtc::DesktopSize& size, | 444 const webrtc::DesktopSize& size, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 } | 483 } |
477 } | 484 } |
478 | 485 |
479 void ClientSession::OnVideoFrameSent(protocol::VideoStream* stream, | 486 void ClientSession::OnVideoFrameSent(protocol::VideoStream* stream, |
480 uint32_t frame_id, | 487 uint32_t frame_id, |
481 int64_t input_event_timestamp) { | 488 int64_t input_event_timestamp) { |
482 // TODO(sergeyu): Send a message to the client to notify about the new frame. | 489 // TODO(sergeyu): Send a message to the client to notify about the new frame. |
483 } | 490 } |
484 | 491 |
485 } // namespace remoting | 492 } // namespace remoting |
OLD | NEW |