Only sync parent directory once after a leveldb file rename.
[chromium-blink-merge.git] / remoting / host / win / session_desktop_environment.cc
blob33add3888d62d4e06f6e6c724ec1a06d00773c58
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 "media/video/capture/screen/screen_capturer.h"
10 #include "remoting/host/audio_capturer.h"
11 #include "remoting/host/input_injector.h"
12 #include "remoting/host/screen_controls.h"
13 #include "remoting/host/win/session_input_injector.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 UiStrings& ui_strings,
48 const base::Closure& inject_sas)
49 : Me2MeDesktopEnvironmentFactory(caller_task_runner,
50 input_task_runner,
51 ui_task_runner,
52 ui_strings),
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 if (!desktop_environment->InitializeSecurity(client_session_control,
70 ui_strings(),
71 curtain_enabled())) {
72 return scoped_ptr<DesktopEnvironment>();
75 return desktop_environment.PassAs<DesktopEnvironment>();
78 } // namespace remoting