Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / remoting / host / me2me_desktop_environment.h
blob331096d02a846e3046dd313ae90f72b55c83db6b
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"
10 namespace remoting {
12 class CurtainMode;
13 class HostWindow;
14 class LocalInputMonitor;
16 // Same as BasicDesktopEnvironment but supports desktop resizing and X DAMAGE
17 // notifications on Linux.
18 class Me2MeDesktopEnvironment : public BasicDesktopEnvironment {
19 public:
20 ~Me2MeDesktopEnvironment() override;
22 // DesktopEnvironment interface.
23 scoped_ptr<ScreenControls> CreateScreenControls() override;
24 std::string GetCapabilities() const override;
25 scoped_ptr<GnubbyAuthHandler> CreateGnubbyAuthHandler(
26 protocol::ClientStub* client_stub) override;
28 protected:
29 friend class Me2MeDesktopEnvironmentFactory;
30 Me2MeDesktopEnvironment(
31 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
32 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
33 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
34 bool supports_touch_events);
36 // Initializes security features of the desktop environment (the curtain mode
37 // and in-session UI).
38 bool InitializeSecurity(
39 base::WeakPtr<ClientSessionControl> client_session_control,
40 bool curtain_enabled);
42 void SetEnableGnubbyAuth(bool gnubby_auth_enabled);
44 private:
45 // "Curtains" the session making sure it is disconnected from the local
46 // console.
47 scoped_ptr<CurtainMode> curtain_;
49 // Presents the disconnect window to the local user.
50 scoped_ptr<HostWindow> disconnect_window_;
52 // Notifies the client session about the local mouse movements.
53 scoped_ptr<LocalInputMonitor> local_input_monitor_;
55 // True if gnubby auth is enabled.
56 bool gnubby_auth_enabled_;
58 DISALLOW_COPY_AND_ASSIGN(Me2MeDesktopEnvironment);
61 // Used to create |Me2MeDesktopEnvironment| instances.
62 class Me2MeDesktopEnvironmentFactory : public BasicDesktopEnvironmentFactory {
63 public:
64 Me2MeDesktopEnvironmentFactory(
65 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
66 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
67 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner);
68 ~Me2MeDesktopEnvironmentFactory() override;
70 // DesktopEnvironmentFactory interface.
71 scoped_ptr<DesktopEnvironment> Create(
72 base::WeakPtr<ClientSessionControl> client_session_control) override;
73 void SetEnableCurtaining(bool enable) override;
74 void SetEnableGnubbyAuth(bool enable) override;
76 protected:
77 bool curtain_enabled() const { return curtain_enabled_; }
79 private:
80 // True if curtain mode is enabled.
81 bool curtain_enabled_;
83 // True if gnubby auth is enabled.
84 bool gnubby_auth_enabled_;
86 DISALLOW_COPY_AND_ASSIGN(Me2MeDesktopEnvironmentFactory);
89 } // namespace remoting
91 #endif // REMOTING_HOST_ME2ME_DESKTOP_ENVIRONMENT_H_