1 // Copyright 2014 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. 4 5 #include "remoting/host/fake_desktop_environment.h" 6 7 #include "remoting/host/audio_capturer.h" 8 #include "remoting/host/fake_desktop_capturer.h" 9 #include "remoting/host/gnubby_auth_handler.h" 10 #include "remoting/host/input_injector.h" 11 12 namespace remoting { 13 FakeInputInjector()14FakeInputInjector::FakeInputInjector() {} ~FakeInputInjector()15FakeInputInjector::~FakeInputInjector() {} 16 Start(scoped_ptr<protocol::ClipboardStub> client_clipboard)17void FakeInputInjector::Start( 18 scoped_ptr<protocol::ClipboardStub> client_clipboard) { 19 } 20 InjectKeyEvent(const protocol::KeyEvent & event)21void FakeInputInjector::InjectKeyEvent(const protocol::KeyEvent& event) { 22 } 23 InjectTextEvent(const protocol::TextEvent & event)24void FakeInputInjector::InjectTextEvent(const protocol::TextEvent& event) { 25 } 26 InjectMouseEvent(const protocol::MouseEvent & event)27void FakeInputInjector::InjectMouseEvent(const protocol::MouseEvent& event) { 28 } 29 InjectClipboardEvent(const protocol::ClipboardEvent & event)30void FakeInputInjector::InjectClipboardEvent( 31 const protocol::ClipboardEvent& event) { 32 } 33 FakeScreenControls()34FakeScreenControls::FakeScreenControls() {} ~FakeScreenControls()35FakeScreenControls::~FakeScreenControls() {} 36 SetScreenResolution(const ScreenResolution & resolution)37void FakeScreenControls::SetScreenResolution( 38 const ScreenResolution& resolution) { 39 } 40 FakeDesktopEnvironment()41FakeDesktopEnvironment::FakeDesktopEnvironment() {} 42 ~FakeDesktopEnvironment()43FakeDesktopEnvironment::~FakeDesktopEnvironment() {} 44 45 // DesktopEnvironment implementation. CreateAudioCapturer()46scoped_ptr<AudioCapturer> FakeDesktopEnvironment::CreateAudioCapturer() { 47 return scoped_ptr<AudioCapturer>(); 48 } 49 CreateInputInjector()50scoped_ptr<InputInjector> FakeDesktopEnvironment::CreateInputInjector() { 51 return scoped_ptr<InputInjector>(new FakeInputInjector()); 52 } 53 CreateScreenControls()54scoped_ptr<ScreenControls> FakeDesktopEnvironment::CreateScreenControls() { 55 return scoped_ptr<ScreenControls>(new FakeScreenControls()); 56 } 57 58 scoped_ptr<webrtc::DesktopCapturer> CreateVideoCapturer()59FakeDesktopEnvironment::CreateVideoCapturer() { 60 scoped_ptr<FakeDesktopCapturer> result(new FakeDesktopCapturer()); 61 if (!frame_generator_.is_null()) 62 result->set_frame_generator(frame_generator_); 63 return result.PassAs<webrtc::DesktopCapturer>(); 64 } 65 66 scoped_ptr<webrtc::MouseCursorMonitor> CreateMouseCursorMonitor()67FakeDesktopEnvironment::CreateMouseCursorMonitor() { 68 return scoped_ptr<webrtc::MouseCursorMonitor>(new FakeMouseCursorMonitor()); 69 } 70 GetCapabilities() const71std::string FakeDesktopEnvironment::GetCapabilities() const { 72 return std::string(); 73 } 74 SetCapabilities(const std::string & capabilities)75void FakeDesktopEnvironment::SetCapabilities(const std::string& capabilities) {} 76 CreateGnubbyAuthHandler(protocol::ClientStub * client_stub)77scoped_ptr<GnubbyAuthHandler> FakeDesktopEnvironment::CreateGnubbyAuthHandler( 78 protocol::ClientStub* client_stub) { 79 return scoped_ptr<GnubbyAuthHandler>(); 80 } 81 FakeDesktopEnvironmentFactory()82FakeDesktopEnvironmentFactory::FakeDesktopEnvironmentFactory() {} ~FakeDesktopEnvironmentFactory()83FakeDesktopEnvironmentFactory::~FakeDesktopEnvironmentFactory() {} 84 85 // DesktopEnvironmentFactory implementation. Create(base::WeakPtr<ClientSessionControl> client_session_control)86scoped_ptr<DesktopEnvironment> FakeDesktopEnvironmentFactory::Create( 87 base::WeakPtr<ClientSessionControl> client_session_control) { 88 scoped_ptr<FakeDesktopEnvironment> result(new FakeDesktopEnvironment()); 89 result->set_frame_generator(frame_generator_); 90 return result.PassAs<DesktopEnvironment>(); 91 } 92 SetEnableCurtaining(bool enable)93void FakeDesktopEnvironmentFactory::SetEnableCurtaining(bool enable) {} 94 SupportsAudioCapture() const95bool FakeDesktopEnvironmentFactory::SupportsAudioCapture() const { 96 return false; 97 } 98 SetEnableGnubbyAuth(bool enable)99void FakeDesktopEnvironmentFactory::SetEnableGnubbyAuth(bool enable) {} 100 101 102 } // namespace remoting 103