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"
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(),
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
,
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
,
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(),
67 if (!desktop_environment
->InitializeSecurity(client_session_control
,
69 return scoped_ptr
<DesktopEnvironment
>();
72 return desktop_environment
.PassAs
<DesktopEnvironment
>();
75 } // namespace remoting