Only sync parent directory once after a leveldb file rename.
[chromium-blink-merge.git] / remoting / host / basic_desktop_environment.cc
blob2a05104fff5e7e488ba57366ae82b338dfa0bb86
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/basic_desktop_environment.h"
7 #include "base/bind.h"
8 #include "base/logging.h"
9 #include "base/single_thread_task_runner.h"
10 #include "media/video/capture/screen/screen_capturer.h"
11 #include "remoting/host/audio_capturer.h"
12 #include "remoting/host/client_session_control.h"
13 #include "remoting/host/input_injector.h"
14 #include "remoting/host/screen_controls.h"
16 namespace remoting {
18 BasicDesktopEnvironment::~BasicDesktopEnvironment() {
19 DCHECK(caller_task_runner_->BelongsToCurrentThread());
22 scoped_ptr<AudioCapturer> BasicDesktopEnvironment::CreateAudioCapturer() {
23 DCHECK(caller_task_runner_->BelongsToCurrentThread());
25 return AudioCapturer::Create();
28 scoped_ptr<InputInjector> BasicDesktopEnvironment::CreateInputInjector() {
29 DCHECK(caller_task_runner_->BelongsToCurrentThread());
31 return InputInjector::Create(input_task_runner(), ui_task_runner());
34 scoped_ptr<ScreenControls> BasicDesktopEnvironment::CreateScreenControls() {
35 DCHECK(caller_task_runner_->BelongsToCurrentThread());
37 return scoped_ptr<ScreenControls>();
40 std::string BasicDesktopEnvironment::GetCapabilities() const {
41 return std::string();
44 void BasicDesktopEnvironment::SetCapabilities(const std::string& capabilities) {
47 scoped_ptr<media::ScreenCapturer>
48 BasicDesktopEnvironment::CreateVideoCapturer() {
49 DCHECK(caller_task_runner_->BelongsToCurrentThread());
51 // The basic desktop environment does not use X DAMAGE, since it is
52 // broken on many systems - see http://crbug.com/73423.
53 return media::ScreenCapturer::Create();
56 BasicDesktopEnvironment::BasicDesktopEnvironment(
57 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
58 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
59 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner)
60 : caller_task_runner_(caller_task_runner),
61 input_task_runner_(input_task_runner),
62 ui_task_runner_(ui_task_runner) {
63 DCHECK(caller_task_runner_->BelongsToCurrentThread());
66 BasicDesktopEnvironmentFactory::BasicDesktopEnvironmentFactory(
67 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
68 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
69 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
70 const UiStrings& ui_strings)
71 : caller_task_runner_(caller_task_runner),
72 input_task_runner_(input_task_runner),
73 ui_task_runner_(ui_task_runner),
74 ui_strings_(ui_strings) {
77 BasicDesktopEnvironmentFactory::~BasicDesktopEnvironmentFactory() {
80 bool BasicDesktopEnvironmentFactory::SupportsAudioCapture() const {
81 DCHECK(caller_task_runner_->BelongsToCurrentThread());
83 return AudioCapturer::IsSupported();
86 } // namespace remoting