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