BookmarkManager: Fix 'new folder text field size changes on clicking it' issue.
[chromium-blink-merge.git] / remoting / host / win / session_desktop_environment.cc
blobb903fa011f04620af9e830b86e498e3d0eb78e3a
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 bool supports_touch_events)
38 : Me2MeDesktopEnvironment(caller_task_runner,
39 input_task_runner,
40 ui_task_runner,
41 supports_touch_events),
42 inject_sas_(inject_sas) {
45 SessionDesktopEnvironmentFactory::SessionDesktopEnvironmentFactory(
46 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
47 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
48 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
49 const base::Closure& inject_sas)
50 : Me2MeDesktopEnvironmentFactory(caller_task_runner,
51 input_task_runner,
52 ui_task_runner),
53 inject_sas_(inject_sas) {
54 DCHECK(caller_task_runner->BelongsToCurrentThread());
57 SessionDesktopEnvironmentFactory::~SessionDesktopEnvironmentFactory() {
60 scoped_ptr<DesktopEnvironment> SessionDesktopEnvironmentFactory::Create(
61 base::WeakPtr<ClientSessionControl> client_session_control) {
62 DCHECK(caller_task_runner()->BelongsToCurrentThread());
64 scoped_ptr<SessionDesktopEnvironment> desktop_environment(
65 new SessionDesktopEnvironment(caller_task_runner(),
66 input_task_runner(),
67 ui_task_runner(),
68 inject_sas_,
69 supports_touch_events()));
70 if (!desktop_environment->InitializeSecurity(client_session_control,
71 curtain_enabled())) {
72 return nullptr;
75 return desktop_environment.Pass();
78 } // namespace remoting