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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: remoting/host/me2me_single_window_desktop_environment.cc
diff --git a/remoting/host/me2me_single_window_desktop_environment.cc b/remoting/host/me2me_single_window_desktop_environment.cc
new file mode 100644
index 0000000000000000000000000000000000000000..33771961e884f78e6907b534565bce5bbbdeb30b
--- /dev/null
+++ b/remoting/host/me2me_single_window_desktop_environment.cc
@@ -0,0 +1,92 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#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?
+
+#include "base/logging.h"
+#include "base/single_thread_task_runner.h"
+#include "remoting/host/single_window_input_injector.h"
+#include "remoting/host/window_capturer_screen_wrapper.h"
+#include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h"
+#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
+
+namespace remoting {
+
+SingleWindowDesktopEnvironment::~SingleWindowDesktopEnvironment() {
+}
+
+scoped_ptr<webrtc::ScreenCapturer>
+SingleWindowDesktopEnvironment::CreateVideoCapturer() {
+ DCHECK(caller_task_runner()->BelongsToCurrentThread());
+
+ // 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.
+ webrtc::DesktopCaptureOptions options =
+ webrtc::DesktopCaptureOptions::CreateDefault();
+ options.set_use_update_notifications(true);
+
+ // Create a WindowCapturer
Wez 2014/08/06 04:10:15 Nor this one.
ronakvora do not use 2014/08/06 20:56:17 Done.
+ scoped_ptr<webrtc::WindowCapturer>window_capturer(
+ webrtc::WindowCapturer::Create(options));
+ window_capturer->SelectWindow(window_id_);
+
+ // 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.
+ 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.
+ new WindowCapturerScreenWrapper(window_capturer.Pass()));
+
+ return window_capturer_wrapper.PassAs<webrtc::ScreenCapturer>();
+}
+
+scoped_ptr<InputInjector>
+ SingleWindowDesktopEnvironment::CreateInputInjector() {
+ DCHECK(caller_task_runner()->BelongsToCurrentThread());
+
+ 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.
+ InputInjector::Create(input_task_runner(),
+ ui_task_runner()));
+ return SingleWindowInputInjector::Create(window_id_, input_injector.Pass());
+}
+
+SingleWindowDesktopEnvironment::SingleWindowDesktopEnvironment(
+ scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner)
+ : BasicDesktopEnvironment(caller_task_runner,
+ input_task_runner,
+ ui_task_runner) {
+}
+
+void SingleWindowDesktopEnvironment::SetWindowId(
+ webrtc::WindowId windowIdEnvironment) {
Lambros 2014/08/05 22:47:24 window_id
ronakvora do not use 2014/08/06 20:56:17 removed method.
+ DCHECK(caller_task_runner()->BelongsToCurrentThread());
+ window_id_ = windowIdEnvironment;
+}
+
+SingleWindowDesktopEnvironmentFactory::SingleWindowDesktopEnvironmentFactory(
+ scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
+ webrtc::WindowId windowId)
Wez 2014/08/06 04:10:15 window_id
ronakvora do not use 2014/08/06 20:56:17 Done.
+ : BasicDesktopEnvironmentFactory(caller_task_runner,
+ input_task_runner,
+ ui_task_runner) {
+ window_id_ = windowId;
+}
+
+SingleWindowDesktopEnvironmentFactory::
+ ~SingleWindowDesktopEnvironmentFactory() {
+}
+
+scoped_ptr<DesktopEnvironment> SingleWindowDesktopEnvironmentFactory::Create(
+ base::WeakPtr<ClientSessionControl> client_session_control) {
+ DCHECK(caller_task_runner()->BelongsToCurrentThread());
+
+ scoped_ptr<SingleWindowDesktopEnvironment> desktop_environment(
+ new SingleWindowDesktopEnvironment(caller_task_runner(),
+ input_task_runner(),
Lambros 2014/08/05 22:47:24 nit: indentation
ronakvora do not use 2014/08/06 20:56:17 Done.
+ ui_task_runner()));
+ 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.
+ return desktop_environment.PassAs<DesktopEnvironment>();
+}
+
+} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698