| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_HOST_FAKE_DESKTOP_ENVIRONMENT_H_ | 5 #ifndef REMOTING_HOST_FAKE_DESKTOP_ENVIRONMENT_H_ |
| 6 #define REMOTING_HOST_FAKE_DESKTOP_ENVIRONMENT_H_ | 6 #define REMOTING_HOST_FAKE_DESKTOP_ENVIRONMENT_H_ |
| 7 | 7 |
| 8 #include "remoting/host/desktop_environment.h" | 8 #include "remoting/host/desktop_environment.h" |
| 9 #include "remoting/host/fake_desktop_capturer.h" |
| 9 #include "remoting/host/fake_mouse_cursor_monitor.h" | 10 #include "remoting/host/fake_mouse_cursor_monitor.h" |
| 10 #include "remoting/host/fake_screen_capturer.h" | |
| 11 #include "remoting/host/input_injector.h" | 11 #include "remoting/host/input_injector.h" |
| 12 #include "remoting/host/screen_controls.h" | 12 #include "remoting/host/screen_controls.h" |
| 13 | 13 |
| 14 namespace remoting { | 14 namespace remoting { |
| 15 | 15 |
| 16 class FakeInputInjector : public InputInjector { | 16 class FakeInputInjector : public InputInjector { |
| 17 public: | 17 public: |
| 18 FakeInputInjector(); | 18 FakeInputInjector(); |
| 19 virtual ~FakeInputInjector(); | 19 virtual ~FakeInputInjector(); |
| 20 | 20 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 // ScreenControls implementation. | 35 // ScreenControls implementation. |
| 36 virtual void SetScreenResolution(const ScreenResolution& resolution) OVERRIDE; | 36 virtual void SetScreenResolution(const ScreenResolution& resolution) OVERRIDE; |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 class FakeDesktopEnvironment : public DesktopEnvironment { | 39 class FakeDesktopEnvironment : public DesktopEnvironment { |
| 40 public: | 40 public: |
| 41 FakeDesktopEnvironment(); | 41 FakeDesktopEnvironment(); |
| 42 virtual ~FakeDesktopEnvironment(); | 42 virtual ~FakeDesktopEnvironment(); |
| 43 | 43 |
| 44 // Sets frame generator to be used for FakeScreenCapturer created by | 44 // Sets frame generator to be used for FakeDesktopCapturer created by |
| 45 // FakeDesktopEnvironment. | 45 // FakeDesktopEnvironment. |
| 46 void set_frame_generator(FakeScreenCapturer::FrameGenerator frame_generator) { | 46 void set_frame_generator( |
| 47 FakeDesktopCapturer::FrameGenerator frame_generator) { |
| 47 frame_generator_ = frame_generator; | 48 frame_generator_ = frame_generator; |
| 48 } | 49 } |
| 49 | 50 |
| 50 // DesktopEnvironment implementation. | 51 // DesktopEnvironment implementation. |
| 51 virtual scoped_ptr<AudioCapturer> CreateAudioCapturer() OVERRIDE; | 52 virtual scoped_ptr<AudioCapturer> CreateAudioCapturer() OVERRIDE; |
| 52 virtual scoped_ptr<InputInjector> CreateInputInjector() OVERRIDE; | 53 virtual scoped_ptr<InputInjector> CreateInputInjector() OVERRIDE; |
| 53 virtual scoped_ptr<ScreenControls> CreateScreenControls() OVERRIDE; | 54 virtual scoped_ptr<ScreenControls> CreateScreenControls() OVERRIDE; |
| 54 virtual scoped_ptr<webrtc::ScreenCapturer> CreateVideoCapturer() OVERRIDE; | 55 virtual scoped_ptr<webrtc::DesktopCapturer> CreateVideoCapturer() OVERRIDE; |
| 55 virtual scoped_ptr<webrtc::MouseCursorMonitor> CreateMouseCursorMonitor() | 56 virtual scoped_ptr<webrtc::MouseCursorMonitor> CreateMouseCursorMonitor() |
| 56 OVERRIDE; | 57 OVERRIDE; |
| 57 virtual std::string GetCapabilities() const OVERRIDE; | 58 virtual std::string GetCapabilities() const OVERRIDE; |
| 58 virtual void SetCapabilities(const std::string& capabilities) OVERRIDE; | 59 virtual void SetCapabilities(const std::string& capabilities) OVERRIDE; |
| 59 virtual scoped_ptr<GnubbyAuthHandler> CreateGnubbyAuthHandler( | 60 virtual scoped_ptr<GnubbyAuthHandler> CreateGnubbyAuthHandler( |
| 60 protocol::ClientStub* client_stub) OVERRIDE; | 61 protocol::ClientStub* client_stub) OVERRIDE; |
| 61 | 62 |
| 62 private: | 63 private: |
| 63 FakeScreenCapturer::FrameGenerator frame_generator_; | 64 FakeDesktopCapturer::FrameGenerator frame_generator_; |
| 64 | 65 |
| 65 DISALLOW_COPY_AND_ASSIGN(FakeDesktopEnvironment); | 66 DISALLOW_COPY_AND_ASSIGN(FakeDesktopEnvironment); |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 class FakeDesktopEnvironmentFactory : public DesktopEnvironmentFactory { | 69 class FakeDesktopEnvironmentFactory : public DesktopEnvironmentFactory { |
| 69 public: | 70 public: |
| 70 FakeDesktopEnvironmentFactory(); | 71 FakeDesktopEnvironmentFactory(); |
| 71 virtual ~FakeDesktopEnvironmentFactory(); | 72 virtual ~FakeDesktopEnvironmentFactory(); |
| 72 | 73 |
| 73 // Sets frame generator to be used for FakeScreenCapturer created by | 74 // Sets frame generator to be used for FakeDesktopCapturer created by |
| 74 // FakeDesktopEnvironment. | 75 // FakeDesktopEnvironment. |
| 75 void set_frame_generator(FakeScreenCapturer::FrameGenerator frame_generator) { | 76 void set_frame_generator( |
| 77 FakeDesktopCapturer::FrameGenerator frame_generator) { |
| 76 frame_generator_ = frame_generator; | 78 frame_generator_ = frame_generator; |
| 77 } | 79 } |
| 78 | 80 |
| 79 // DesktopEnvironmentFactory implementation. | 81 // DesktopEnvironmentFactory implementation. |
| 80 virtual scoped_ptr<DesktopEnvironment> Create( | 82 virtual scoped_ptr<DesktopEnvironment> Create( |
| 81 base::WeakPtr<ClientSessionControl> client_session_control) OVERRIDE; | 83 base::WeakPtr<ClientSessionControl> client_session_control) OVERRIDE; |
| 82 virtual void SetEnableCurtaining(bool enable) OVERRIDE; | 84 virtual void SetEnableCurtaining(bool enable) OVERRIDE; |
| 83 virtual bool SupportsAudioCapture() const OVERRIDE; | 85 virtual bool SupportsAudioCapture() const OVERRIDE; |
| 84 virtual void SetEnableGnubbyAuth(bool enable) OVERRIDE; | 86 virtual void SetEnableGnubbyAuth(bool enable) OVERRIDE; |
| 85 | 87 |
| 86 private: | 88 private: |
| 87 FakeScreenCapturer::FrameGenerator frame_generator_; | 89 FakeDesktopCapturer::FrameGenerator frame_generator_; |
| 88 | 90 |
| 89 DISALLOW_COPY_AND_ASSIGN(FakeDesktopEnvironmentFactory); | 91 DISALLOW_COPY_AND_ASSIGN(FakeDesktopEnvironmentFactory); |
| 90 }; | 92 }; |
| 91 | 93 |
| 92 } // namespace remoting | 94 } // namespace remoting |
| 93 | 95 |
| 94 #endif // REMOTING_HOST_FAKE_DESKTOP_ENVIRONMENT_H_ | 96 #endif // REMOTING_HOST_FAKE_DESKTOP_ENVIRONMENT_H_ |
| OLD | NEW |