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 | 8 |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "remoting/base/capabilities.h" | 10 #include "remoting/base/capabilities.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" | 33 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" |
34 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h" | 34 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h" |
35 | 35 |
36 // Default DPI to assume for old clients that use notifyClientDimensions. | 36 // Default DPI to assume for old clients that use notifyClientDimensions. |
37 const int kDefaultDPI = 96; | 37 const int kDefaultDPI = 96; |
38 | 38 |
39 namespace remoting { | 39 namespace remoting { |
40 | 40 |
41 namespace { | 41 namespace { |
42 | 42 |
| 43 const char kMultiTouchCapability[] = "multiTouch"; |
| 44 |
43 scoped_ptr<VideoEncoder> CreateVideoEncoder( | 45 scoped_ptr<VideoEncoder> CreateVideoEncoder( |
44 const protocol::SessionConfig& config) { | 46 const protocol::SessionConfig& config) { |
45 const protocol::ChannelConfig& video_config = config.video_config(); | 47 const protocol::ChannelConfig& video_config = config.video_config(); |
46 | 48 |
47 if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) { | 49 if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) { |
48 return VideoEncoderVpx::CreateForVP8().Pass(); | 50 return VideoEncoderVpx::CreateForVP8().Pass(); |
49 } else if (video_config.codec == protocol::ChannelConfig::CODEC_VP9) { | 51 } else if (video_config.codec == protocol::ChannelConfig::CODEC_VP9) { |
50 return VideoEncoderVpx::CreateForVP9().Pass(); | 52 return VideoEncoderVpx::CreateForVP9().Pass(); |
51 } else if (video_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { | 53 } else if (video_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { |
52 return make_scoped_ptr(new VideoEncoderVerbatim()); | 54 return make_scoped_ptr(new VideoEncoderVerbatim()); |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 DisconnectSession(); | 302 DisconnectSession(); |
301 return; | 303 return; |
302 } | 304 } |
303 | 305 |
304 // Connect host stub. | 306 // Connect host stub. |
305 connection_->set_host_stub(this); | 307 connection_->set_host_stub(this); |
306 | 308 |
307 // Connect video stub. | 309 // Connect video stub. |
308 mouse_clamping_filter_.set_video_stub(connection_->video_stub()); | 310 mouse_clamping_filter_.set_video_stub(connection_->video_stub()); |
309 | 311 |
| 312 // Create the event executor. |
| 313 input_injector_ = desktop_environment_->CreateInputInjector(); |
| 314 |
310 // Collate the set of capabilities to offer the client, if it supports them. | 315 // Collate the set of capabilities to offer the client, if it supports them. |
311 host_capabilities_ = desktop_environment_->GetCapabilities(); | 316 host_capabilities_ = desktop_environment_->GetCapabilities(); |
312 if (!host_capabilities_.empty()) | 317 if (!host_capabilities_.empty()) |
313 host_capabilities_.append(" "); | 318 host_capabilities_.append(" "); |
| 319 if (input_injector_->CanInjectTouch()) |
| 320 host_capabilities_.append(std::string(kMultiTouchCapability) + " "); |
314 host_capabilities_.append(extension_manager_->GetCapabilities()); | 321 host_capabilities_.append(extension_manager_->GetCapabilities()); |
315 | 322 |
316 // Create the object that controls the screen resolution. | 323 // Create the object that controls the screen resolution. |
317 screen_controls_ = desktop_environment_->CreateScreenControls(); | 324 screen_controls_ = desktop_environment_->CreateScreenControls(); |
318 | 325 |
319 // Create the event executor. | |
320 input_injector_ = desktop_environment_->CreateInputInjector(); | |
321 | |
322 // Connect the host input stubs. | 326 // Connect the host input stubs. |
323 connection_->set_input_stub(&disable_input_filter_); | 327 connection_->set_input_stub(&disable_input_filter_); |
324 host_input_filter_.set_input_stub(input_injector_.get()); | 328 host_input_filter_.set_input_stub(input_injector_.get()); |
325 | 329 |
326 // Connect the clipboard stubs. | 330 // Connect the clipboard stubs. |
327 connection_->set_clipboard_stub(&disable_clipboard_filter_); | 331 connection_->set_clipboard_stub(&disable_clipboard_filter_); |
328 clipboard_echo_filter_.set_host_stub(input_injector_.get()); | 332 clipboard_echo_filter_.set_host_stub(input_injector_.get()); |
329 clipboard_echo_filter_.set_client_stub(connection_->client_stub()); | 333 clipboard_echo_filter_.set_client_stub(connection_->client_stub()); |
330 | 334 |
331 // Create a GnubbyAuthHandler to proxy gnubbyd messages. | 335 // Create a GnubbyAuthHandler to proxy gnubbyd messages. |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 | 502 |
499 scoped_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() { | 503 scoped_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() { |
500 DCHECK(CalledOnValidThread()); | 504 DCHECK(CalledOnValidThread()); |
501 | 505 |
502 return make_scoped_ptr( | 506 return make_scoped_ptr( |
503 new protocol::ClipboardThreadProxy(client_clipboard_factory_.GetWeakPtr(), | 507 new protocol::ClipboardThreadProxy(client_clipboard_factory_.GetWeakPtr(), |
504 base::MessageLoopProxy::current())); | 508 base::MessageLoopProxy::current())); |
505 } | 509 } |
506 | 510 |
507 } // namespace remoting | 511 } // namespace remoting |
OLD | NEW |