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/me2me_desktop_environment.h" | 5 #include "remoting/host/me2me_desktop_environment.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
9 #include "remoting/host/client_session_control.h" | 9 #include "remoting/host/client_session_control.h" |
10 #include "remoting/host/curtain_mode.h" | 10 #include "remoting/host/curtain_mode.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 31 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
32 } | 32 } |
33 | 33 |
34 scoped_ptr<ScreenControls> Me2MeDesktopEnvironment::CreateScreenControls() { | 34 scoped_ptr<ScreenControls> Me2MeDesktopEnvironment::CreateScreenControls() { |
35 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 35 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
36 | 36 |
37 return scoped_ptr<ScreenControls>( | 37 return scoped_ptr<ScreenControls>( |
38 new ResizingHostObserver(DesktopResizer::Create())); | 38 new ResizingHostObserver(DesktopResizer::Create())); |
39 } | 39 } |
40 | 40 |
41 scoped_ptr<webrtc::ScreenCapturer> | |
42 Me2MeDesktopEnvironment::CreateVideoCapturer() { | |
43 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | |
44 webrtc::DesktopCaptureOptions options = | |
45 webrtc::DesktopCaptureOptions::CreateDefault(); | |
46 options.set_use_update_notifications(true); | |
47 return scoped_ptr<webrtc::ScreenCapturer>( | |
48 webrtc::ScreenCapturer::Create(options)); | |
49 } | |
50 | |
51 std::string Me2MeDesktopEnvironment::GetCapabilities() const { | 41 std::string Me2MeDesktopEnvironment::GetCapabilities() const { |
52 return kRateLimitResizeRequests; | 42 return kRateLimitResizeRequests; |
53 } | 43 } |
54 | 44 |
55 Me2MeDesktopEnvironment::Me2MeDesktopEnvironment( | 45 Me2MeDesktopEnvironment::Me2MeDesktopEnvironment( |
56 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 46 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
57 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 47 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
58 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) | 48 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) |
59 : BasicDesktopEnvironment(caller_task_runner, | 49 : BasicDesktopEnvironment(caller_task_runner, |
60 input_task_runner, | 50 input_task_runner, |
61 ui_task_runner) { | 51 ui_task_runner) { |
62 DCHECK(caller_task_runner->BelongsToCurrentThread()); | 52 DCHECK(caller_task_runner->BelongsToCurrentThread()); |
| 53 desktop_capture_options()->set_use_update_notifications(true); |
63 } | 54 } |
64 | 55 |
65 bool Me2MeDesktopEnvironment::InitializeSecurity( | 56 bool Me2MeDesktopEnvironment::InitializeSecurity( |
66 base::WeakPtr<ClientSessionControl> client_session_control, | 57 base::WeakPtr<ClientSessionControl> client_session_control, |
67 bool curtain_enabled) { | 58 bool curtain_enabled) { |
68 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 59 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
69 | 60 |
70 // Detach the session from the local console if the caller requested. | 61 // Detach the session from the local console if the caller requested. |
71 if (curtain_enabled) { | 62 if (curtain_enabled) { |
72 curtain_ = CurtainMode::Create(caller_task_runner(), | 63 curtain_ = CurtainMode::Create(caller_task_runner(), |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 return desktop_environment.PassAs<DesktopEnvironment>(); | 135 return desktop_environment.PassAs<DesktopEnvironment>(); |
145 } | 136 } |
146 | 137 |
147 void Me2MeDesktopEnvironmentFactory::SetEnableCurtaining(bool enable) { | 138 void Me2MeDesktopEnvironmentFactory::SetEnableCurtaining(bool enable) { |
148 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 139 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
149 | 140 |
150 curtain_enabled_ = enable; | 141 curtain_enabled_ = enable; |
151 } | 142 } |
152 | 143 |
153 } // namespace remoting | 144 } // namespace remoting |
OLD | NEW |