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

Unified Diff: remoting/host/client_session.cc

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: Move clipboard events to the control channel. 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 side-by-side diff with in-line comments
Download patch
Index: remoting/host/client_session.cc
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc
index 6ff6164add558a5ff006bc22d5a38b0f5ea16f77..3f63d8ab89f68252444cb27af601e32a923d9708 100644
--- a/remoting/host/client_session.cc
+++ b/remoting/host/client_session.cc
@@ -22,17 +22,20 @@ static const int64 kRemoteBlockTimeoutMillis = 2000;
namespace remoting {
+using protocol::ClipboardEvent;
Sergey Ulanov 2012/03/14 20:27:07 There is only one place when this is used, so mayb
simonmorris 2012/03/14 21:20:21 Done.
using protocol::KeyEvent;
using protocol::MouseEvent;
ClientSession::ClientSession(
EventHandler* event_handler,
protocol::ConnectionToClient* connection,
+ protocol::ClipboardStub* clipboard_stub,
protocol::InputStub* input_stub,
Capturer* capturer)
: event_handler_(event_handler),
connection_(connection),
client_jid_(connection->session()->jid()),
+ clipboard_stub_(clipboard_stub),
input_stub_(input_stub),
capturer_(capturer),
authenticated_(false),
@@ -43,6 +46,7 @@ ClientSession::ClientSession(
// TODO(sergeyu): Currently ConnectionToClient expects stubs to be
// set before channels are connected. Make it possible to set stubs
// later and set them only when connection is authenticated.
+ connection_->set_clipboard_stub(this);
connection_->set_host_stub(this);
connection_->set_input_stub(this);
}
@@ -50,6 +54,14 @@ ClientSession::ClientSession(
ClientSession::~ClientSession() {
}
+void ClientSession::InjectClipboardEvent(const ClipboardEvent& event) {
+ DCHECK(CalledOnValidThread());
+
+ if (authenticated_) {
+ clipboard_stub_->InjectClipboardEvent(event);
+ }
+}
+
void ClientSession::InjectKeyEvent(const KeyEvent& event) {
DCHECK(CalledOnValidThread());

Powered by Google App Engine
This is Rietveld 408576698