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

Side by Side Diff: remoting/host/me2me_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: uploaded to remove lint errors 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 (c) 2012 The Chromium Authors. All rights reserved.
Lambros 2014/07/30 00:14:49 "(c) 2012" -> "2014"
ronakvora do not use 2014/07/30 20:55:36 Done.
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 #if defined(OS_POSIX)
Lambros 2014/07/30 00:14:49 Don't need this OS_POSIX block.
ronakvora do not use 2014/07/30 20:55:36 Done.
8 #include <sys/types.h>
9 #include <unistd.h>
10 #endif // defined(OS_POSIX)
11
12 #include "base/logging.h"
Lambros 2014/07/30 00:14:49 Do we really need all these #includes? For example
ronakvora do not use 2014/07/30 20:55:36 Done.
13 #include "base/single_thread_task_runner.h"
14 #include "remoting/base/logging.h"
15 #include "remoting/host/client_session_control.h"
16 #include "remoting/host/curtain_mode.h"
17 #include "remoting/host/desktop_resizer.h"
18 #include "remoting/host/gnubby_auth_handler.h"
19 #include "remoting/host/host_window.h"
20 #include "remoting/host/host_window_proxy.h"
21 #include "remoting/host/local_input_monitor.h"
22 #include "remoting/host/resizing_host_observer.h"
23 #include "remoting/host/screen_controls.h"
24 #include "remoting/host/window_capturer_screen_wrapper.h"
25 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h"
26 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
27
28 namespace remoting {
29
30 Me2MeWindowDesktopEnvironment::~Me2MeWindowDesktopEnvironment() {
31 DCHECK(caller_task_runner()->BelongsToCurrentThread());
32 }
33
34 scoped_ptr<webrtc::ScreenCapturer>
35 Me2MeWindowDesktopEnvironment::CreateVideoCapturer() {
36 LOG(INFO) << "video capturer created";
37 DCHECK(caller_task_runner()->BelongsToCurrentThread());
38 webrtc::DesktopCaptureOptions options =
39 webrtc::DesktopCaptureOptions::CreateDefault();
40 options.set_use_update_notifications(true);
41 // change this to the wrapper class
42 scoped_ptr<remoting::WindowCapturerScreenWrapper>window_capturer(
43 remoting::WindowCapturerScreenWrapper::Create());
44 window_capturer->SetWindow(options);
45 window_capturer->SelectWindow(windowIdEnvironment_);
46 return window_capturer.PassAs<webrtc::ScreenCapturer>();
47 }
48
49 scoped_ptr<InputInjector> Me2MeWindowDesktopEnvironment::CreateInputInjector() {
50 DCHECK(caller_task_runner()->BelongsToCurrentThread());
51 // TODO(sidj, sskhandp) Create a WindowInputInjectorMac and instantiate
52 // that instead.
53 return InputInjector::Create(input_task_runner(),
54 ui_task_runner(),
55 windowIdEnvironment_,
56 enable_window_capture_environment_);
57 }
58
59 Me2MeWindowDesktopEnvironment::Me2MeWindowDesktopEnvironment(
60 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
61 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
62 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner)
63 : BasicDesktopEnvironment(caller_task_runner,
64 input_task_runner,
65 ui_task_runner) {
66 DCHECK(caller_task_runner->BelongsToCurrentThread());
67 }
68
69 void Me2MeWindowDesktopEnvironment::SetWindowId
70 (webrtc::WindowId windowIdEnvironment) {
71 windowIdEnvironment_ = windowIdEnvironment;
72 }
73
74 void Me2MeWindowDesktopEnvironment::SetEnableWindowCapture
75 (bool enable_window_capture_environment) {
76 enable_window_capture_environment_ = enable_window_capture_environment;
77 }
78
79 Me2MeWindowDesktopEnvironmentFactory::Me2MeWindowDesktopEnvironmentFactory(
80 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
81 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
82 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
83 webrtc::WindowId windowId,
84 bool enable_window_capture)
85 : BasicDesktopEnvironmentFactory(caller_task_runner,
86 input_task_runner,
87 ui_task_runner) {
88 enable_window_capture_environment_factory_ = enable_window_capture;
89 windowIdEnvironmentFactory_ = windowId;
90 }
91
92 Me2MeWindowDesktopEnvironmentFactory::~Me2MeWindowDesktopEnvironmentFactory() {
93 }
94
95 scoped_ptr<DesktopEnvironment> Me2MeWindowDesktopEnvironmentFactory::Create(
96 base::WeakPtr<ClientSessionControl> client_session_control) {
97 LOG(INFO) << "desktop environment created";
98 DCHECK(caller_task_runner()->BelongsToCurrentThread());
99
100 scoped_ptr<Me2MeWindowDesktopEnvironment> desktop_environment(
101 new Me2MeWindowDesktopEnvironment(caller_task_runner(),
102 input_task_runner(),
103 ui_task_runner()));
104 desktop_environment->SetWindowId(windowIdEnvironmentFactory_);
105 desktop_environment->
106 SetEnableWindowCapture(enable_window_capture_environment_factory_);
107 return desktop_environment.PassAs<DesktopEnvironment>();
108 }
109
110 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698