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 #ifndef REMOTING_HOST_ME2ME_DESKTOP_ENVIRONMENT_H_
6 #define REMOTING_HOST_ME2ME_DESKTOP_ENVIRONMENT_H_
8 #include "remoting/host/basic_desktop_environment.h"
14 class LocalInputMonitor
;
16 // Same as BasicDesktopEnvironment but supports desktop resizing and X DAMAGE
17 // notifications on Linux.
18 class Me2MeDesktopEnvironment
: public BasicDesktopEnvironment
{
20 virtual ~Me2MeDesktopEnvironment();
22 // DesktopEnvironment interface.
23 virtual scoped_ptr
<ScreenControls
> CreateScreenControls() OVERRIDE
;
24 virtual scoped_ptr
<media::ScreenCapturer
> CreateVideoCapturer() OVERRIDE
;
27 friend class Me2MeDesktopEnvironmentFactory
;
28 Me2MeDesktopEnvironment(
29 scoped_refptr
<base::SingleThreadTaskRunner
> caller_task_runner
,
30 scoped_refptr
<base::SingleThreadTaskRunner
> input_task_runner
,
31 scoped_refptr
<base::SingleThreadTaskRunner
> ui_task_runner
);
33 // Initializes security features of the desktop environment (the curtain mode
34 // and in-session UI).
35 bool InitializeSecurity(
36 base::WeakPtr
<ClientSessionControl
> client_session_control
,
37 const UiStrings
& ui_strings
,
38 bool curtain_enabled
);
41 // "Curtains" the session making sure it is disconnected from the local
43 scoped_ptr
<CurtainMode
> curtain_
;
45 // Presents the disconnect window to the local user.
46 scoped_ptr
<HostWindow
> disconnect_window_
;
48 // Notifies the client session about the local mouse movements.
49 scoped_ptr
<LocalInputMonitor
> local_input_monitor_
;
51 DISALLOW_COPY_AND_ASSIGN(Me2MeDesktopEnvironment
);
54 // Used to create |Me2MeDesktopEnvironment| instances.
55 class Me2MeDesktopEnvironmentFactory
: public BasicDesktopEnvironmentFactory
{
57 Me2MeDesktopEnvironmentFactory(
58 scoped_refptr
<base::SingleThreadTaskRunner
> caller_task_runner
,
59 scoped_refptr
<base::SingleThreadTaskRunner
> input_task_runner
,
60 scoped_refptr
<base::SingleThreadTaskRunner
> ui_task_runner
,
61 const UiStrings
& ui_strings
);
62 virtual ~Me2MeDesktopEnvironmentFactory();
64 // DesktopEnvironmentFactory interface.
65 virtual scoped_ptr
<DesktopEnvironment
> Create(
66 base::WeakPtr
<ClientSessionControl
> client_session_control
) OVERRIDE
;
67 virtual void SetEnableCurtaining(bool enable
) OVERRIDE
;
70 bool curtain_enabled() const { return curtain_enabled_
; }
73 // True if curtain mode is enabled.
74 bool curtain_enabled_
;
76 DISALLOW_COPY_AND_ASSIGN(Me2MeDesktopEnvironmentFactory
);
79 } // namespace remoting
81 #endif // REMOTING_HOST_ME2ME_DESKTOP_ENVIRONMENT_H_