Index: remoting/client/jni/chromoting_jni_instance.cc |
diff --git a/remoting/client/jni/chromoting_jni_instance.cc b/remoting/client/jni/chromoting_jni_instance.cc |
index 6c6f075c7f21173b11650f1af05bae6c13b47d76..47a0b25d4c61c45a5f26d33de01719eb31f42e6b 100644 |
--- a/remoting/client/jni/chromoting_jni_instance.cc |
+++ b/remoting/client/jni/chromoting_jni_instance.cc |
@@ -75,14 +75,41 @@ void ChromotingJniInstance::RedrawDesktop() { |
display_task_runner()->BelongsToCurrentThread()) { |
ChromotingJni::GetInstance()->display_task_runner()->PostTask( |
FROM_HERE, |
- base::Bind(&ChromotingJniInstance::RedrawDesktop, |
- this)); |
+ base::Bind(&ChromotingJniInstance::RedrawDesktop, this)); |
return; |
} |
ChromotingJni::GetInstance()->RedrawCanvas(); |
} |
+void ChromotingJniInstance::PerformMouseAction( |
+ int x, |
+ int y, |
+ protocol::MouseEvent_MouseButton button) { |
garykac
2013/07/20 21:25:26
This should be a MouseEvent so that you have all t
solb
2013/07/22 19:13:48
Since this is being called from the JNI binding in
|
+ if(!ChromotingJni::GetInstance()-> |
+ network_task_runner()->BelongsToCurrentThread()) { |
+ ChromotingJni::GetInstance()->network_task_runner()->PostTask( |
+ FROM_HERE, |
+ base::Bind(&ChromotingJniInstance::PerformMouseAction, |
+ this, |
+ x, |
+ y, |
+ button)); |
+ return; |
+ } |
+ |
+ protocol::MouseEvent action; |
+ action.set_x(x); |
+ action.set_y(y); |
+ if (button!=protocol::MouseEvent::BUTTON_UNDEFINED) { |
+ action.set_button( |
+ static_cast<protocol::MouseEvent_MouseButton>(abs(button))); |
garykac
2013/07/20 21:25:26
abs(button)...
This whole static_cast ickiness go
solb
2013/07/22 19:13:48
I accomplished this with a boolean flag, as aforem
|
+ action.set_button_down(button > 0); |
+ } |
+ |
+ connection_->input_stub()->InjectMouseEvent(action); |
+} |
+ |
void ChromotingJniInstance::OnConnectionState( |
protocol::ConnectionToHost::State state, |
protocol::ErrorCode error) { |
@@ -113,13 +140,11 @@ void ChromotingJniInstance::SetPairingResponse( |
} |
protocol::ClipboardStub* ChromotingJniInstance::GetClipboardStub() { |
- NOTIMPLEMENTED(); |
- return NULL; |
+ return this; |
} |
protocol::CursorShapeStub* ChromotingJniInstance::GetCursorShapeStub() { |
- NOTIMPLEMENTED(); |
- return NULL; |
+ return this; |
} |
scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher> |
@@ -128,6 +153,16 @@ scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher> |
return scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher>(); |
} |
+void ChromotingJniInstance::InjectClipboardEvent( |
+ const protocol::ClipboardEvent& event) { |
+ NOTIMPLEMENTED(); |
+} |
+ |
+void ChromotingJniInstance::SetCursorShape( |
+ const protocol::CursorShapeInfo& shape) { |
+ NOTIMPLEMENTED(); |
+} |
+ |
void ChromotingJniInstance::ConnectToHostOnDisplayThread() { |
DCHECK(ChromotingJni::GetInstance()-> |
display_task_runner()->BelongsToCurrentThread()); |