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 #ifndef REMOTING_HOST_CLIENT_SESSION_H_ | 5 #ifndef REMOTING_HOST_CLIENT_SESSION_H_ |
6 #define REMOTING_HOST_CLIENT_SESSION_H_ | 6 #define REMOTING_HOST_CLIENT_SESSION_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 void Disconnect(); | 126 void Disconnect(); |
127 | 127 |
128 // Stops the ClientSession, and calls |stopped_task| on |network_task_runner_| | 128 // Stops the ClientSession, and calls |stopped_task| on |network_task_runner_| |
129 // when fully stopped. | 129 // when fully stopped. |
130 void Stop(const base::Closure& stopped_task); | 130 void Stop(const base::Closure& stopped_task); |
131 | 131 |
132 protocol::ConnectionToClient* connection() const { | 132 protocol::ConnectionToClient* connection() const { |
133 return connection_.get(); | 133 return connection_.get(); |
134 } | 134 } |
135 | 135 |
| 136 DesktopEnvironment* desktop_environment() const { |
| 137 return desktop_environment_.get(); |
| 138 } |
| 139 |
136 const std::string& client_jid() { return client_jid_; } | 140 const std::string& client_jid() { return client_jid_; } |
137 | 141 |
138 bool is_authenticated() { return auth_input_filter_.enabled(); } | 142 bool is_authenticated() { return auth_input_filter_.enabled(); } |
139 | 143 |
140 // Indicate that local mouse activity has been detected. This causes remote | 144 // Indicate that local mouse activity has been detected. This causes remote |
141 // inputs to be ignored for a short time so that the local user will always | 145 // inputs to be ignored for a short time so that the local user will always |
142 // have the upper hand in 'pointer wars'. | 146 // have the upper hand in 'pointer wars'. |
143 void LocalMouseMoved(const SkIPoint& new_pos); | 147 void LocalMouseMoved(const SkIPoint& new_pos); |
144 | 148 |
145 // Disable handling of input events from this client. If the client has any | 149 // Disable handling of input events from this client. If the client has any |
(...skipping 24 matching lines...) Expand all Loading... |
170 scoped_ptr<protocol::ConnectionToClient> connection_; | 174 scoped_ptr<protocol::ConnectionToClient> connection_; |
171 | 175 |
172 // Used to disable callbacks to |connection_| once it is disconnected. | 176 // Used to disable callbacks to |connection_| once it is disconnected. |
173 base::WeakPtrFactory<protocol::ConnectionToClient> connection_factory_; | 177 base::WeakPtrFactory<protocol::ConnectionToClient> connection_factory_; |
174 | 178 |
175 // The desktop environment used by this session. | 179 // The desktop environment used by this session. |
176 scoped_ptr<DesktopEnvironment> desktop_environment_; | 180 scoped_ptr<DesktopEnvironment> desktop_environment_; |
177 | 181 |
178 std::string client_jid_; | 182 std::string client_jid_; |
179 | 183 |
180 // Filter used as the final element in the input pipeline. | 184 // The host clipboard and input stubs to which this object delegates. |
181 protocol::InputFilter host_input_filter_; | 185 // These are the final elements in the clipboard & input pipelines, which |
| 186 // appear in order below. |
| 187 protocol::ClipboardStub* host_clipboard_stub_; |
| 188 protocol::InputStub* host_input_stub_; |
182 | 189 |
183 // Tracker used to release pressed keys and buttons when disconnecting. | 190 // Tracker used to release pressed keys and buttons when disconnecting. |
184 protocol::InputEventTracker input_tracker_; | 191 protocol::InputEventTracker input_tracker_; |
185 | 192 |
186 // Filter used to disable remote inputs during local input activity. | 193 // Filter used to disable remote inputs during local input activity. |
187 RemoteInputFilter remote_input_filter_; | 194 RemoteInputFilter remote_input_filter_; |
188 | 195 |
189 // Filter used to clamp mouse events to the current display dimensions. | 196 // Filter used to clamp mouse events to the current display dimensions. |
190 MouseClampingFilter mouse_clamping_filter_; | 197 MouseClampingFilter mouse_clamping_filter_; |
191 | 198 |
192 // Filter to used to stop clipboard items sent from the client being echoed | 199 // Filter to used to stop clipboard items sent from the client being echoed |
193 // back to it. It is the final element in the clipboard (client -> host) | 200 // back to it. |
194 // pipeline. | |
195 protocol::ClipboardEchoFilter clipboard_echo_filter_; | 201 protocol::ClipboardEchoFilter clipboard_echo_filter_; |
196 | 202 |
197 // Filters used to manage enabling & disabling of input & clipboard. | 203 // Filters used to manage enabling & disabling of input & clipboard. |
198 protocol::InputFilter disable_input_filter_; | 204 protocol::InputFilter disable_input_filter_; |
199 protocol::ClipboardFilter disable_clipboard_filter_; | 205 protocol::ClipboardFilter disable_clipboard_filter_; |
200 | 206 |
201 // Filters used to disable input & clipboard when we're not authenticated. | 207 // Filters used to disable input & clipboard when we're not authenticated. |
202 protocol::InputFilter auth_input_filter_; | 208 protocol::InputFilter auth_input_filter_; |
203 protocol::ClipboardFilter auth_clipboard_filter_; | 209 protocol::ClipboardFilter auth_clipboard_filter_; |
204 | 210 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 }; | 242 }; |
237 | 243 |
238 // Destroys |ClienSession| instances on the network thread. | 244 // Destroys |ClienSession| instances on the network thread. |
239 struct ClientSessionTraits { | 245 struct ClientSessionTraits { |
240 static void Destruct(const ClientSession* client); | 246 static void Destruct(const ClientSession* client); |
241 }; | 247 }; |
242 | 248 |
243 } // namespace remoting | 249 } // namespace remoting |
244 | 250 |
245 #endif // REMOTING_HOST_CLIENT_SESSION_H_ | 251 #endif // REMOTING_HOST_CLIENT_SESSION_H_ |
OLD | NEW |