OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #include "remoting/host/desktop_session_win.h" | 5 #include "remoting/host/desktop_session_win.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <sddl.h> | 8 #include <sddl.h> |
9 | 9 |
10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // attach/detach events via |WtsConsoleObserer|. | 84 // attach/detach events via |WtsConsoleObserer|. |
85 class ConsoleSession : public DesktopSessionWin { | 85 class ConsoleSession : public DesktopSessionWin { |
86 public: | 86 public: |
87 // Same as DesktopSessionWin(). | 87 // Same as DesktopSessionWin(). |
88 ConsoleSession( | 88 ConsoleSession( |
89 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, | 89 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
90 scoped_refptr<AutoThreadTaskRunner> io_task_runner, | 90 scoped_refptr<AutoThreadTaskRunner> io_task_runner, |
91 DaemonProcess* daemon_process, | 91 DaemonProcess* daemon_process, |
92 int id, | 92 int id, |
93 WtsTerminalMonitor* monitor); | 93 WtsTerminalMonitor* monitor); |
94 virtual ~ConsoleSession(); | 94 ~ConsoleSession() override; |
95 | 95 |
96 protected: | 96 protected: |
97 // DesktopSession overrides. | 97 // DesktopSession overrides. |
98 virtual void SetScreenResolution(const ScreenResolution& resolution) override; | 98 void SetScreenResolution(const ScreenResolution& resolution) override; |
99 | 99 |
100 // DesktopSessionWin overrides. | 100 // DesktopSessionWin overrides. |
101 virtual void InjectSas() override; | 101 void InjectSas() override; |
102 | 102 |
103 private: | 103 private: |
104 scoped_ptr<SasInjector> sas_injector_; | 104 scoped_ptr<SasInjector> sas_injector_; |
105 | 105 |
106 DISALLOW_COPY_AND_ASSIGN(ConsoleSession); | 106 DISALLOW_COPY_AND_ASSIGN(ConsoleSession); |
107 }; | 107 }; |
108 | 108 |
109 // DesktopSession implementation which attaches to virtual RDP console. | 109 // DesktopSession implementation which attaches to virtual RDP console. |
110 // Receives IPC messages from the desktop process, running in the console | 110 // Receives IPC messages from the desktop process, running in the console |
111 // session, via |WorkerProcessIpcDelegate|, and monitors console session | 111 // session, via |WorkerProcessIpcDelegate|, and monitors console session |
112 // attach/detach events via |WtsConsoleObserer|. | 112 // attach/detach events via |WtsConsoleObserer|. |
113 class RdpSession : public DesktopSessionWin { | 113 class RdpSession : public DesktopSessionWin { |
114 public: | 114 public: |
115 // Same as DesktopSessionWin(). | 115 // Same as DesktopSessionWin(). |
116 RdpSession( | 116 RdpSession( |
117 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, | 117 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
118 scoped_refptr<AutoThreadTaskRunner> io_task_runner, | 118 scoped_refptr<AutoThreadTaskRunner> io_task_runner, |
119 DaemonProcess* daemon_process, | 119 DaemonProcess* daemon_process, |
120 int id, | 120 int id, |
121 WtsTerminalMonitor* monitor); | 121 WtsTerminalMonitor* monitor); |
122 virtual ~RdpSession(); | 122 ~RdpSession() override; |
123 | 123 |
124 // Performs the part of initialization that can fail. | 124 // Performs the part of initialization that can fail. |
125 bool Initialize(const ScreenResolution& resolution); | 125 bool Initialize(const ScreenResolution& resolution); |
126 | 126 |
127 // Mirrors IRdpDesktopSessionEventHandler. | 127 // Mirrors IRdpDesktopSessionEventHandler. |
128 void OnRdpConnected(); | 128 void OnRdpConnected(); |
129 void OnRdpClosed(); | 129 void OnRdpClosed(); |
130 | 130 |
131 protected: | 131 protected: |
132 // DesktopSession overrides. | 132 // DesktopSession overrides. |
133 virtual void SetScreenResolution(const ScreenResolution& resolution) override; | 133 void SetScreenResolution(const ScreenResolution& resolution) override; |
134 | 134 |
135 // DesktopSessionWin overrides. | 135 // DesktopSessionWin overrides. |
136 virtual void InjectSas() override; | 136 void InjectSas() override; |
137 | 137 |
138 private: | 138 private: |
139 // An implementation of IRdpDesktopSessionEventHandler interface that forwards | 139 // An implementation of IRdpDesktopSessionEventHandler interface that forwards |
140 // notifications to the owning desktop session. | 140 // notifications to the owning desktop session. |
141 class EventHandler : public IRdpDesktopSessionEventHandler { | 141 class EventHandler : public IRdpDesktopSessionEventHandler { |
142 public: | 142 public: |
143 explicit EventHandler(base::WeakPtr<RdpSession> desktop_session); | 143 explicit EventHandler(base::WeakPtr<RdpSession> desktop_session); |
144 virtual ~EventHandler(); | 144 virtual ~EventHandler(); |
145 | 145 |
146 // IUnknown interface. | 146 // IUnknown interface. |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 exploded.hour, | 598 exploded.hour, |
599 exploded.minute, | 599 exploded.minute, |
600 exploded.second, | 600 exploded.second, |
601 exploded.millisecond, | 601 exploded.millisecond, |
602 passed.c_str()); | 602 passed.c_str()); |
603 | 603 |
604 last_timestamp_ = now; | 604 last_timestamp_ = now; |
605 } | 605 } |
606 | 606 |
607 } // namespace remoting | 607 } // namespace remoting |
OLD | NEW |