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

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: Refactor InputStub, ClipboardStub, and HostEventStub. 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..d41f41fda173a2ba1107ee5b203d50792c85b69c 100644
--- a/remoting/host/client_session.cc
+++ b/remoting/host/client_session.cc
@@ -28,11 +28,13 @@ 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 +45,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 +53,15 @@ ClientSession::ClientSession(
ClientSession::~ClientSession() {
}
+void ClientSession::InjectClipboardEvent(
+ const protocol::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