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

Side by Side Diff: remoting/client/jni/chromoting_jni_instance.cc

Issue 23532072: Draw the mouse cursor in Chromoting Android client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add synchronization Created 7 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "remoting/client/jni/chromoting_jni_instance.h" 5 #include "remoting/client/jni/chromoting_jni_instance.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "jingle/glue/xmpp_client_socket_factory.h" 9 #include "jingle/glue/xmpp_client_socket_factory.h"
10 #include "net/socket/client_socket_factory.h" 10 #include "net/socket/client_socket_factory.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 return scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher>(); 209 return scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher>();
210 } 210 }
211 211
212 void ChromotingJniInstance::InjectClipboardEvent( 212 void ChromotingJniInstance::InjectClipboardEvent(
213 const protocol::ClipboardEvent& event) { 213 const protocol::ClipboardEvent& event) {
214 NOTIMPLEMENTED(); 214 NOTIMPLEMENTED();
215 } 215 }
216 216
217 void ChromotingJniInstance::SetCursorShape( 217 void ChromotingJniInstance::SetCursorShape(
218 const protocol::CursorShapeInfo& shape) { 218 const protocol::CursorShapeInfo& shape) {
219 NOTIMPLEMENTED(); 219 if (!jni_runtime_->display_task_runner()->BelongsToCurrentThread()) {
220 jni_runtime_->display_task_runner()->PostTask(
221 FROM_HERE,
222 base::Bind(&ChromotingJniInstance::SetCursorShape, this, shape));
223 return;
224 }
225
226 jni_runtime_->UpdateCursorShape(shape);
220 } 227 }
221 228
222 void ChromotingJniInstance::ConnectToHostOnDisplayThread() { 229 void ChromotingJniInstance::ConnectToHostOnDisplayThread() {
223 DCHECK(jni_runtime_->display_task_runner()->BelongsToCurrentThread()); 230 DCHECK(jni_runtime_->display_task_runner()->BelongsToCurrentThread());
224 231
225 frame_consumer_ = new FrameConsumerProxy(jni_runtime_->display_task_runner()); 232 frame_consumer_ = new FrameConsumerProxy(jni_runtime_->display_task_runner());
226 view_.reset(new JniFrameConsumer(jni_runtime_)); 233 view_.reset(new JniFrameConsumer(jni_runtime_));
227 view_weak_factory_.reset(new base::WeakPtrFactory<JniFrameConsumer>( 234 view_weak_factory_.reset(new base::WeakPtrFactory<JniFrameConsumer>(
228 view_.get())); 235 view_.get()));
229 frame_consumer_->Attach(view_weak_factory_->GetWeakPtr()); 236 frame_consumer_->Attach(view_weak_factory_->GetWeakPtr());
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 // Unless we forget about the stale credentials, we'll continue trying them. 297 // Unless we forget about the stale credentials, we'll continue trying them.
291 LOG(INFO) << "Deleting rejected pairing credentials"; 298 LOG(INFO) << "Deleting rejected pairing credentials";
292 jni_runtime_->CommitPairingCredentials(host_id_, "", ""); 299 jni_runtime_->CommitPairingCredentials(host_id_, "", "");
293 } 300 }
294 301
295 pin_callback_ = callback; 302 pin_callback_ = callback;
296 jni_runtime_->DisplayAuthenticationPrompt(pairable); 303 jni_runtime_->DisplayAuthenticationPrompt(pairable);
297 } 304 }
298 305
299 } // namespace remoting 306 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698