Roll src/third_party/WebKit f36d5e0:68b67cd (svn 193299:193303)
[chromium-blink-merge.git] / remoting / host / win / session_desktop_environment.cc
blob3336482f69f3c99d28b73f82806dc3e95555a99e
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
3 // found in the LICENSE file.
5 #include "remoting/host/win/session_desktop_environment.h"
7 #include "base/logging.h"
8 #include "base/single_thread_task_runner.h"
9 #include "remoting/host/audio_capturer.h"
10 #include "remoting/host/input_injector.h"
11 #include "remoting/host/screen_controls.h"
12 #include "remoting/host/win/session_input_injector.h"
13 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
15 namespace remoting {
17 SessionDesktopEnvironment::~SessionDesktopEnvironment() {
20 scoped_ptr<InputInjector> SessionDesktopEnvironment::CreateInputInjector() {
21 DCHECK(caller_task_runner()->BelongsToCurrentThread());
23 scoped_ptr<InputInjector> input_injector = InputInjector::Create(
24 input_task_runner(), ui_task_runner());
25 input_injector.reset(new SessionInputInjectorWin(input_task_runner(),
26 input_injector.Pass(),
27 ui_task_runner(),
28 inject_sas_));
29 return input_injector.Pass();
32 SessionDesktopEnvironment::SessionDesktopEnvironment(
33 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
34 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
35 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
36 const base::Closure& inject_sas)
37 : Me2MeDesktopEnvironment(caller_task_runner,
38 input_task_runner,
39 ui_task_runner),
40 inject_sas_(inject_sas) {
43 SessionDesktopEnvironmentFactory::SessionDesktopEnvironmentFactory(
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 const base::Closure& inject_sas)
48 : Me2MeDesktopEnvironmentFactory(caller_task_runner,
49 input_task_runner,
50 ui_task_runner),
51 inject_sas_(inject_sas) {
52 DCHECK(caller_task_runner->BelongsToCurrentThread());
55 SessionDesktopEnvironmentFactory::~SessionDesktopEnvironmentFactory() {
58 scoped_ptr<DesktopEnvironment> SessionDesktopEnvironmentFactory::Create(
59 base::WeakPtr<ClientSessionControl> client_session_control) {
60 DCHECK(caller_task_runner()->BelongsToCurrentThread());
62 scoped_ptr<SessionDesktopEnvironment> desktop_environment(
63 new SessionDesktopEnvironment(caller_task_runner(),
64 input_task_runner(),
65 ui_task_runner(),
66 inject_sas_));
67 if (!desktop_environment->InitializeSecurity(client_session_control,
68 curtain_enabled())) {
69 return nullptr;
72 return desktop_environment.Pass();
75 } // namespace remoting