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

Unified Diff: remoting/client/jingle_host_connection.cc

Issue 3175028: Add mouse event support to Chromoting client (Pepper and X11). (Closed)
Patch Set: Remove win float/int conversion Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/jingle_host_connection.h ('k') | remoting/client/plugin/chromoting_instance.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/jingle_host_connection.cc
diff --git a/remoting/client/jingle_host_connection.cc b/remoting/client/jingle_host_connection.cc
index 27de4264784f060fc5709c9f667b0f888836f2a8..4892883af606558f30fba05a3613229a139bb83d 100644
--- a/remoting/client/jingle_host_connection.cc
+++ b/remoting/client/jingle_host_connection.cc
@@ -4,6 +4,7 @@
#include "base/message_loop.h"
#include "remoting/base/constants.h"
+#include "remoting/base/protocol_util.h"
#include "remoting/client/client_config.h"
#include "remoting/client/jingle_host_connection.h"
#include "remoting/jingle_glue/jingle_thread.h"
@@ -32,6 +33,22 @@ void JingleHostConnection::Disconnect() {
NewRunnableMethod(this, &JingleHostConnection::DoDisconnect));
}
+void JingleHostConnection::SendEvent(const ChromotingClientMessage& msg) {
+ if (message_loop() != MessageLoop::current()) {
+ message_loop()->PostTask(
+ FROM_HERE,
+ NewRunnableMethod(this, &JingleHostConnection::SendEvent, msg));
+ return;
+ }
+
+ // Don't send messages if we're disconnected.
+ if (jingle_channel_ == NULL) {
+ return;
+ }
+
+ jingle_channel_->Write(SerializeAndFrameMessage(msg));
+}
+
void JingleHostConnection::OnStateChange(JingleChannel* channel,
JingleChannel::State state) {
DCHECK_EQ(message_loop(), MessageLoop::current());
« no previous file with comments | « remoting/client/jingle_host_connection.h ('k') | remoting/client/plugin/chromoting_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698