Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: remoting/host/me2me_single_window_desktop_environment.cc

Issue 422503004: Adding ability to stream windows and inject events to them (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comments, removed extraneous commented out code, and reformatted. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 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_single_window_desktop_environment.h"
Wez 2014/08/06 04:10:15 As for the header, this file needs to move to sing
ronakvora do not use 2014/08/06 20:56:17 What do you mean? Just needs to be renamed?
6
7 #include "base/logging.h"
8 #include "base/single_thread_task_runner.h"
9 #include "remoting/host/single_window_input_injector.h"
10 #include "remoting/host/window_capturer_screen_wrapper.h"
11 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h"
12 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
13
14 namespace remoting {
15
16 SingleWindowDesktopEnvironment::~SingleWindowDesktopEnvironment() {
17 }
18
19 scoped_ptr<webrtc::ScreenCapturer>
20 SingleWindowDesktopEnvironment::CreateVideoCapturer() {
21 DCHECK(caller_task_runner()->BelongsToCurrentThread());
22
23 // Use the default capturing options with the WindowCapturer
Wez 2014/08/06 04:10:15 nit: You don't really need this comment.
ronakvora do not use 2014/08/06 20:56:17 Done.
24 webrtc::DesktopCaptureOptions options =
25 webrtc::DesktopCaptureOptions::CreateDefault();
26 options.set_use_update_notifications(true);
27
28 // Create a WindowCapturer
Wez 2014/08/06 04:10:15 Nor this one.
ronakvora do not use 2014/08/06 20:56:17 Done.
29 scoped_ptr<webrtc::WindowCapturer>window_capturer(
30 webrtc::WindowCapturer::Create(options));
31 window_capturer->SelectWindow(window_id_);
32
33 // Wrap WindowCapturer in a ScreenCapturer interface
Wez 2014/08/06 04:10:15 Update this comment to explicitly state that we ha
ronakvora do not use 2014/08/06 20:56:17 Done.
34 scoped_ptr<WindowCapturerScreenWrapper>window_capturer_wrapper(
Lambros 2014/08/05 22:47:24 nit: space after '>'.
ronakvora do not use 2014/08/06 20:56:17 Done.
35 new WindowCapturerScreenWrapper(window_capturer.Pass()));
36
37 return window_capturer_wrapper.PassAs<webrtc::ScreenCapturer>();
38 }
39
40 scoped_ptr<InputInjector>
41 SingleWindowDesktopEnvironment::CreateInputInjector() {
42 DCHECK(caller_task_runner()->BelongsToCurrentThread());
43
44 scoped_ptr<InputInjector>input_injector(
Lambros 2014/08/05 22:47:24 nit: space after '>'
ronakvora do not use 2014/08/06 20:56:17 Done.
45 InputInjector::Create(input_task_runner(),
46 ui_task_runner()));
47 return SingleWindowInputInjector::Create(window_id_, input_injector.Pass());
48 }
49
50 SingleWindowDesktopEnvironment::SingleWindowDesktopEnvironment(
51 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
52 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
53 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner)
54 : BasicDesktopEnvironment(caller_task_runner,
55 input_task_runner,
56 ui_task_runner) {
57 }
58
59 void SingleWindowDesktopEnvironment::SetWindowId(
60 webrtc::WindowId windowIdEnvironment) {
Lambros 2014/08/05 22:47:24 window_id
ronakvora do not use 2014/08/06 20:56:17 removed method.
61 DCHECK(caller_task_runner()->BelongsToCurrentThread());
62 window_id_ = windowIdEnvironment;
63 }
64
65 SingleWindowDesktopEnvironmentFactory::SingleWindowDesktopEnvironmentFactory(
66 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
67 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
68 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
69 webrtc::WindowId windowId)
Wez 2014/08/06 04:10:15 window_id
ronakvora do not use 2014/08/06 20:56:17 Done.
70 : BasicDesktopEnvironmentFactory(caller_task_runner,
71 input_task_runner,
72 ui_task_runner) {
73 window_id_ = windowId;
74 }
75
76 SingleWindowDesktopEnvironmentFactory::
77 ~SingleWindowDesktopEnvironmentFactory() {
78 }
79
80 scoped_ptr<DesktopEnvironment> SingleWindowDesktopEnvironmentFactory::Create(
81 base::WeakPtr<ClientSessionControl> client_session_control) {
82 DCHECK(caller_task_runner()->BelongsToCurrentThread());
83
84 scoped_ptr<SingleWindowDesktopEnvironment> desktop_environment(
85 new SingleWindowDesktopEnvironment(caller_task_runner(),
86 input_task_runner(),
Lambros 2014/08/05 22:47:24 nit: indentation
ronakvora do not use 2014/08/06 20:56:17 Done.
87 ui_task_runner()));
88 desktop_environment->SetWindowId(window_id_);
Wez 2014/08/06 04:10:15 Can this go in the ctor?
ronakvora do not use 2014/08/06 20:56:17 Yep, done.
89 return desktop_environment.PassAs<DesktopEnvironment>();
90 }
91
92 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698