Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: remoting/host/client_session.h

Issue 10829409: Add MouseClampingFilter and update ClientSession to use it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Avoid implementation inheritance in MouseClampingFilter. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | remoting/host/client_session.cc » ('j') | remoting/host/mouse_clamping_filter.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/time.h" 10 #include "base/time.h"
11 #include "base/timer.h" 11 #include "base/timer.h"
12 #include "base/threading/non_thread_safe.h" 12 #include "base/threading/non_thread_safe.h"
13 #include "remoting/host/mouse_clamping_filter.h"
13 #include "remoting/host/remote_input_filter.h" 14 #include "remoting/host/remote_input_filter.h"
14 #include "remoting/protocol/clipboard_echo_filter.h" 15 #include "remoting/protocol/clipboard_echo_filter.h"
15 #include "remoting/protocol/clipboard_filter.h" 16 #include "remoting/protocol/clipboard_filter.h"
16 #include "remoting/protocol/clipboard_stub.h" 17 #include "remoting/protocol/clipboard_stub.h"
17 #include "remoting/protocol/connection_to_client.h" 18 #include "remoting/protocol/connection_to_client.h"
18 #include "remoting/protocol/host_stub.h" 19 #include "remoting/protocol/host_stub.h"
19 #include "remoting/protocol/input_event_tracker.h" 20 #include "remoting/protocol/input_event_tracker.h"
20 #include "remoting/protocol/input_filter.h" 21 #include "remoting/protocol/input_filter.h"
21 #include "remoting/protocol/input_stub.h" 22 #include "remoting/protocol/input_stub.h"
22 #include "remoting/protocol/mouse_input_filter.h" 23 #include "remoting/protocol/mouse_input_filter.h"
23 #include "third_party/skia/include/core/SkPoint.h" 24 #include "third_party/skia/include/core/SkPoint.h"
24 25
25 namespace remoting { 26 namespace remoting {
26 27
27 class VideoFrameCapturer; 28 class VideoFrameCapturer;
28 29
29 // A ClientSession keeps a reference to a connection to a client, and maintains 30 // A ClientSession keeps a reference to a connection to a client, and maintains
30 // per-client state. 31 // per-client state.
31 class ClientSession : public protocol::HostStub, 32 class ClientSession : public protocol::HostStub,
32 public protocol::InputStub,
33 public protocol::ConnectionToClient::EventHandler, 33 public protocol::ConnectionToClient::EventHandler,
34 public base::NonThreadSafe { 34 public base::NonThreadSafe {
35 public: 35 public:
36 // Callback interface for passing events to the ChromotingHost. 36 // Callback interface for passing events to the ChromotingHost.
37 class EventHandler { 37 class EventHandler {
38 public: 38 public:
39 // Called after authentication has finished successfully. 39 // Called after authentication has finished successfully.
40 virtual void OnSessionAuthenticated(ClientSession* client) = 0; 40 virtual void OnSessionAuthenticated(ClientSession* client) = 0;
41 41
42 // Called after we've finished connecting all channels. 42 // Called after we've finished connecting all channels.
(...skipping 24 matching lines...) Expand all
67 }; 67 };
68 68
69 ClientSession(EventHandler* event_handler, 69 ClientSession(EventHandler* event_handler,
70 scoped_ptr<protocol::ConnectionToClient> connection, 70 scoped_ptr<protocol::ConnectionToClient> connection,
71 protocol::ClipboardStub* host_clipboard_stub, 71 protocol::ClipboardStub* host_clipboard_stub,
72 protocol::InputStub* host_input_stub, 72 protocol::InputStub* host_input_stub,
73 VideoFrameCapturer* capturer, 73 VideoFrameCapturer* capturer,
74 const base::TimeDelta& max_duration); 74 const base::TimeDelta& max_duration);
75 virtual ~ClientSession(); 75 virtual ~ClientSession();
76 76
77 // protocol::InputStub interface.
78 virtual void InjectKeyEvent(const protocol::KeyEvent& event) OVERRIDE;
79 virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE;
80
81 // protocol::HostStub interface. 77 // protocol::HostStub interface.
82 virtual void NotifyClientDimensions( 78 virtual void NotifyClientDimensions(
83 const protocol::ClientDimensions& dimensions) OVERRIDE; 79 const protocol::ClientDimensions& dimensions) OVERRIDE;
84 virtual void ControlVideo( 80 virtual void ControlVideo(
85 const protocol::VideoControl& video_control) OVERRIDE; 81 const protocol::VideoControl& video_control) OVERRIDE;
86 82
87 // protocol::ConnectionToClient::EventHandler interface. 83 // protocol::ConnectionToClient::EventHandler interface.
88 virtual void OnConnectionAuthenticated( 84 virtual void OnConnectionAuthenticated(
89 protocol::ConnectionToClient* connection) OVERRIDE; 85 protocol::ConnectionToClient* connection) OVERRIDE;
90 virtual void OnConnectionChannelsConnected( 86 virtual void OnConnectionChannelsConnected(
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 // appear in order below. 134 // appear in order below.
139 protocol::ClipboardStub* host_clipboard_stub_; 135 protocol::ClipboardStub* host_clipboard_stub_;
140 protocol::InputStub* host_input_stub_; 136 protocol::InputStub* host_input_stub_;
141 137
142 // Tracker used to release pressed keys and buttons when disconnecting. 138 // Tracker used to release pressed keys and buttons when disconnecting.
143 protocol::InputEventTracker input_tracker_; 139 protocol::InputEventTracker input_tracker_;
144 140
145 // Filter used to disable remote inputs during local input activity. 141 // Filter used to disable remote inputs during local input activity.
146 RemoteInputFilter remote_input_filter_; 142 RemoteInputFilter remote_input_filter_;
147 143
148 // Filter used to clamp mouse events to the current display dimensions. 144 // Filters used to clamp mouse events to the current display dimensions.
149 protocol::MouseInputFilter mouse_input_filter_; 145 protocol::MouseInputFilter mouse_input_filter_;
146 MouseClampingFilter mouse_clamping_filter_;
150 147
151 // Filters used to manage enabling & disabling of input & clipboard. 148 // Filters used to manage enabling & disabling of input & clipboard.
152 protocol::InputFilter disable_input_filter_; 149 protocol::InputFilter disable_input_filter_;
153 protocol::ClipboardFilter disable_clipboard_filter_; 150 protocol::ClipboardFilter disable_clipboard_filter_;
154 151
155 // Filters used to disable input & clipboard when we're not authenticated. 152 // Filters used to disable input & clipboard when we're not authenticated.
156 protocol::InputFilter auth_input_filter_; 153 protocol::InputFilter auth_input_filter_;
157 protocol::ClipboardFilter auth_clipboard_filter_; 154 protocol::ClipboardFilter auth_clipboard_filter_;
158 155
159 // Filter to used to stop clipboard items sent from the client being echoed 156 // Filter to used to stop clipboard items sent from the client being echoed
(...skipping 18 matching lines...) Expand all
178 // A timer that triggers a disconnect when the maximum session duration 175 // A timer that triggers a disconnect when the maximum session duration
179 // is reached. 176 // is reached.
180 base::OneShotTimer<ClientSession> max_duration_timer_; 177 base::OneShotTimer<ClientSession> max_duration_timer_;
181 178
182 DISALLOW_COPY_AND_ASSIGN(ClientSession); 179 DISALLOW_COPY_AND_ASSIGN(ClientSession);
183 }; 180 };
184 181
185 } // namespace remoting 182 } // namespace remoting
186 183
187 #endif // REMOTING_HOST_CLIENT_SESSION_H_ 184 #endif // REMOTING_HOST_CLIENT_SESSION_H_
OLDNEW
« no previous file with comments | « no previous file | remoting/host/client_session.cc » ('j') | remoting/host/mouse_clamping_filter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698