OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "remoting/host/me2me_window_desktop_environment.h" | |
6 | |
7 #include "base/logging.h" | |
8 #include "base/single_thread_task_runner.h" | |
9 #include "remoting/host/window_capturer_screen_wrapper.h" | |
10 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h" | |
11 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" | |
12 | |
13 namespace remoting { | |
14 | |
15 Me2MeWindowDesktopEnvironment::~Me2MeWindowDesktopEnvironment() { | |
16 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | |
Wez
2014/08/01 23:41:54
~BasicDesktopEnvironment already checks this.
ronakvora do not use
2014/08/05 19:54:50
Removed.
| |
17 } | |
18 | |
19 scoped_ptr<webrtc::ScreenCapturer> | |
20 Me2MeWindowDesktopEnvironment::CreateVideoCapturer() { | |
21 LOG(INFO) << "video capturer created"; | |
Wez
2014/08/01 23:41:54
Remove this log line.
ronakvora do not use
2014/08/05 19:54:50
Done.
| |
22 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | |
Wez
2014/08/01 23:41:54
Please add blank lines to break this function up i
ronakvora do not use
2014/08/05 19:54:49
Done. I also refactored the SetWindow method of Wi
| |
23 webrtc::DesktopCaptureOptions options = | |
24 webrtc::DesktopCaptureOptions::CreateDefault(); | |
25 options.set_use_update_notifications(true); | |
26 // change this to the wrapper class | |
27 scoped_ptr<remoting::WindowCapturerScreenWrapper>window_capturer( | |
28 new WindowCapturerScreenWrapper()); | |
29 window_capturer->SetWindow(options); | |
30 window_capturer->SelectWindow(windowIdEnvironment_); | |
31 return window_capturer.PassAs<webrtc::ScreenCapturer>(); | |
32 } | |
33 | |
34 scoped_ptr<InputInjector> Me2MeWindowDesktopEnvironment::CreateInputInjector() { | |
35 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | |
36 // TODO(sidj, sskhandp) Create a WindowInputInjectorMac and instantiate | |
37 // that instead. | |
38 return InputInjector::CreateForWindow(input_task_runner(), | |
39 ui_task_runner(), | |
40 windowIdEnvironment_); | |
41 } | |
42 | |
43 Me2MeWindowDesktopEnvironment::Me2MeWindowDesktopEnvironment( | |
44 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | |
45 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | |
46 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) | |
47 : BasicDesktopEnvironment(caller_task_runner, | |
48 input_task_runner, | |
49 ui_task_runner) { | |
50 DCHECK(caller_task_runner->BelongsToCurrentThread()); | |
Wez
2014/08/01 23:41:54
This check probably belongs in the BasicDesktopEnv
ronakvora do not use
2014/08/05 19:54:49
Removed.
| |
51 } | |
52 | |
53 void Me2MeWindowDesktopEnvironment::SetWindowId | |
54 (webrtc::WindowId windowIdEnvironment) { | |
Wez
2014/08/01 23:41:54
Wrap after the ( not before.
Wez
2014/08/01 23:41:54
Check the thread here.
ronakvora do not use
2014/08/05 19:54:50
Done.
ronakvora do not use
2014/08/05 19:54:50
Done.
| |
55 windowIdEnvironment_ = windowIdEnvironment; | |
56 } | |
57 | |
58 Me2MeWindowDesktopEnvironmentFactory::Me2MeWindowDesktopEnvironmentFactory( | |
59 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | |
60 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | |
61 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | |
62 webrtc::WindowId windowId) | |
63 : BasicDesktopEnvironmentFactory(caller_task_runner, | |
64 input_task_runner, | |
65 ui_task_runner) { | |
66 windowIdEnvironmentFactory_ = windowId; | |
67 } | |
68 | |
69 Me2MeWindowDesktopEnvironmentFactory::~Me2MeWindowDesktopEnvironmentFactory() { | |
70 } | |
71 | |
72 scoped_ptr<DesktopEnvironment> Me2MeWindowDesktopEnvironmentFactory::Create( | |
73 base::WeakPtr<ClientSessionControl> client_session_control) { | |
74 LOG(INFO) << "desktop environment created"; | |
Wez
2014/08/01 23:41:54
nit: Remove this logging.
ronakvora do not use
2014/08/05 19:54:49
Done.
| |
75 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | |
76 | |
77 scoped_ptr<Me2MeWindowDesktopEnvironment> desktop_environment( | |
78 new Me2MeWindowDesktopEnvironment(caller_task_runner(), | |
79 input_task_runner(), | |
80 ui_task_runner())); | |
81 desktop_environment->SetWindowId(windowIdEnvironmentFactory_); | |
82 return desktop_environment.PassAs<DesktopEnvironment>(); | |
83 } | |
84 | |
85 } // namespace remoting | |
OLD | NEW |