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

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

Issue 9646013: Add the plumbing that will carry a clipboard item from a chromoting client to a host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync, and make InputStub inherit from ClipboardStub. Created 8 years, 9 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
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 #include <set> 9 #include <set>
10 10
11 #include "base/time.h" 11 #include "base/time.h"
12 #include "base/threading/non_thread_safe.h" 12 #include "base/threading/non_thread_safe.h"
13 #include "remoting/protocol/clipboard_stub.h"
13 #include "remoting/protocol/connection_to_client.h" 14 #include "remoting/protocol/connection_to_client.h"
14 #include "remoting/protocol/host_stub.h" 15 #include "remoting/protocol/host_stub.h"
15 #include "remoting/protocol/input_stub.h" 16 #include "remoting/protocol/input_stub.h"
16 #include "third_party/skia/include/core/SkPoint.h" 17 #include "third_party/skia/include/core/SkPoint.h"
17 18
18 namespace remoting { 19 namespace remoting {
19 20
20 class Capturer; 21 class Capturer;
21 22
22 // A ClientSession keeps a reference to a connection to a client, and maintains 23 // A ClientSession keeps a reference to a connection to a client, and maintains
(...skipping 27 matching lines...) Expand all
50 // Called on notification of a route change event, when a channel is 51 // Called on notification of a route change event, when a channel is
51 // connected. 52 // connected.
52 virtual void OnSessionRouteChange( 53 virtual void OnSessionRouteChange(
53 ClientSession* client, 54 ClientSession* client,
54 const std::string& channel_name, 55 const std::string& channel_name,
55 const net::IPEndPoint& remote_end_point, 56 const net::IPEndPoint& remote_end_point,
56 const net::IPEndPoint& local_end_point) = 0; 57 const net::IPEndPoint& local_end_point) = 0;
57 }; 58 };
58 59
59 // Takes ownership of |connection|. Does not take ownership of 60 // Takes ownership of |connection|. Does not take ownership of
60 // |event_handler|, |input_stub| or |capturer|. 61 // |event_handler|, |clipboard_stub|, |input_stub| or |capturer|.
61 ClientSession(EventHandler* event_handler, 62 ClientSession(EventHandler* event_handler,
62 protocol::ConnectionToClient* connection, 63 protocol::ConnectionToClient* connection,
64 protocol::ClipboardStub* clipboard_stub,
Wez 2012/03/15 01:14:44 While the ClipboardStub is part of the InputStub,
simonmorris 2012/03/15 16:53:19 ClipboardStub is no longer part of InputStub. But
63 protocol::InputStub* input_stub, 65 protocol::InputStub* input_stub,
64 Capturer* capturer); 66 Capturer* capturer);
65 virtual ~ClientSession(); 67 virtual ~ClientSession();
66 68
69 // protocol::ClipboardStub interface.
70 virtual void InjectClipboardEvent(
71 const protocol::ClipboardEvent& event) OVERRIDE;
72
67 // protocol::InputStub interface. 73 // protocol::InputStub interface.
68 virtual void InjectKeyEvent(const protocol::KeyEvent& event) OVERRIDE; 74 virtual void InjectKeyEvent(const protocol::KeyEvent& event) OVERRIDE;
69 virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE; 75 virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE;
70 76
71 // protocol::ConnectionToClient::EventHandler interface. 77 // protocol::ConnectionToClient::EventHandler interface.
72 virtual void OnConnectionOpened( 78 virtual void OnConnectionOpened(
73 protocol::ConnectionToClient* connection) OVERRIDE; 79 protocol::ConnectionToClient* connection) OVERRIDE;
74 virtual void OnConnectionClosed( 80 virtual void OnConnectionClosed(
75 protocol::ConnectionToClient* connection) OVERRIDE; 81 protocol::ConnectionToClient* connection) OVERRIDE;
76 virtual void OnConnectionFailed(protocol::ConnectionToClient* connection, 82 virtual void OnConnectionFailed(protocol::ConnectionToClient* connection,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // when the user disconnects. 129 // when the user disconnects.
124 void RestoreEventState(); 130 void RestoreEventState();
125 131
126 EventHandler* event_handler_; 132 EventHandler* event_handler_;
127 133
128 // The connection to the client. 134 // The connection to the client.
129 scoped_ptr<protocol::ConnectionToClient> connection_; 135 scoped_ptr<protocol::ConnectionToClient> connection_;
130 136
131 std::string client_jid_; 137 std::string client_jid_;
132 138
139 // The clipboard stub to which this object delegates.
140 protocol::ClipboardStub* clipboard_stub_;
141
133 // The input stub to which this object delegates. 142 // The input stub to which this object delegates.
134 protocol::InputStub* input_stub_; 143 protocol::InputStub* input_stub_;
135 144
136 // Capturer, used to determine current screen size for ensuring injected 145 // Capturer, used to determine current screen size for ensuring injected
137 // mouse events fall within the screen area. 146 // mouse events fall within the screen area.
138 // TODO(lambroslambrou): Move floor-control logic, and clamping to screen 147 // TODO(lambroslambrou): Move floor-control logic, and clamping to screen
139 // area, out of this class (crbug.com/96508). 148 // area, out of this class (crbug.com/96508).
140 Capturer* capturer_; 149 Capturer* capturer_;
141 150
142 // Whether this client is authenticated. 151 // Whether this client is authenticated.
(...skipping 20 matching lines...) Expand all
163 // Set of keys that are currently pressed down by the user. This is used so 172 // Set of keys that are currently pressed down by the user. This is used so
164 // we can release them if the user disconnects. 173 // we can release them if the user disconnects.
165 std::set<int> pressed_keys_; 174 std::set<int> pressed_keys_;
166 175
167 DISALLOW_COPY_AND_ASSIGN(ClientSession); 176 DISALLOW_COPY_AND_ASSIGN(ClientSession);
168 }; 177 };
169 178
170 } // namespace remoting 179 } // namespace remoting
171 180
172 #endif // REMOTING_HOST_CLIENT_SESSION_H_ 181 #endif // REMOTING_HOST_CLIENT_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698