Convert env to a defaultdict in run_executable() to fix other callers of that function.
[chromium-blink-merge.git] / remoting / host / fake_desktop_environment.h
blob64d293a8487995fab8f1437914f856843728306b
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.
5 #ifndef REMOTING_HOST_FAKE_DESKTOP_ENVIRONMENT_H_
6 #define REMOTING_HOST_FAKE_DESKTOP_ENVIRONMENT_H_
8 #include "remoting/host/desktop_environment.h"
9 #include "remoting/host/fake_desktop_capturer.h"
10 #include "remoting/host/fake_mouse_cursor_monitor.h"
11 #include "remoting/host/input_injector.h"
12 #include "remoting/host/screen_controls.h"
14 namespace remoting {
16 class FakeInputInjector : public InputInjector {
17 public:
18 FakeInputInjector();
19 virtual ~FakeInputInjector();
21 virtual void Start(
22 scoped_ptr<protocol::ClipboardStub> client_clipboard) override;
23 virtual void InjectKeyEvent(const protocol::KeyEvent& event) override;
24 virtual void InjectTextEvent(const protocol::TextEvent& event) override;
25 virtual void InjectMouseEvent(const protocol::MouseEvent& event) override;
26 virtual void InjectClipboardEvent(
27 const protocol::ClipboardEvent& event) override;
30 class FakeScreenControls : public ScreenControls {
31 public:
32 FakeScreenControls();
33 virtual ~FakeScreenControls();
35 // ScreenControls implementation.
36 virtual void SetScreenResolution(const ScreenResolution& resolution) override;
39 class FakeDesktopEnvironment : public DesktopEnvironment {
40 public:
41 FakeDesktopEnvironment();
42 virtual ~FakeDesktopEnvironment();
44 // Sets frame generator to be used for FakeDesktopCapturer created by
45 // FakeDesktopEnvironment.
46 void set_frame_generator(
47 FakeDesktopCapturer::FrameGenerator frame_generator) {
48 frame_generator_ = frame_generator;
51 // DesktopEnvironment implementation.
52 virtual scoped_ptr<AudioCapturer> CreateAudioCapturer() override;
53 virtual scoped_ptr<InputInjector> CreateInputInjector() override;
54 virtual scoped_ptr<ScreenControls> CreateScreenControls() override;
55 virtual scoped_ptr<webrtc::DesktopCapturer> CreateVideoCapturer() override;
56 virtual scoped_ptr<webrtc::MouseCursorMonitor> CreateMouseCursorMonitor()
57 override;
58 virtual std::string GetCapabilities() const override;
59 virtual void SetCapabilities(const std::string& capabilities) override;
60 virtual scoped_ptr<GnubbyAuthHandler> CreateGnubbyAuthHandler(
61 protocol::ClientStub* client_stub) override;
63 private:
64 FakeDesktopCapturer::FrameGenerator frame_generator_;
66 DISALLOW_COPY_AND_ASSIGN(FakeDesktopEnvironment);
69 class FakeDesktopEnvironmentFactory : public DesktopEnvironmentFactory {
70 public:
71 FakeDesktopEnvironmentFactory();
72 virtual ~FakeDesktopEnvironmentFactory();
74 // Sets frame generator to be used for FakeDesktopCapturer created by
75 // FakeDesktopEnvironment.
76 void set_frame_generator(
77 FakeDesktopCapturer::FrameGenerator frame_generator) {
78 frame_generator_ = frame_generator;
81 // DesktopEnvironmentFactory implementation.
82 virtual scoped_ptr<DesktopEnvironment> Create(
83 base::WeakPtr<ClientSessionControl> client_session_control) override;
84 virtual void SetEnableCurtaining(bool enable) override;
85 virtual bool SupportsAudioCapture() const override;
86 virtual void SetEnableGnubbyAuth(bool enable) override;
88 private:
89 FakeDesktopCapturer::FrameGenerator frame_generator_;
91 DISALLOW_COPY_AND_ASSIGN(FakeDesktopEnvironmentFactory);
94 } // namespace remoting
96 #endif // REMOTING_HOST_FAKE_DESKTOP_ENVIRONMENT_H_