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

Side by Side Diff: remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java

Issue 214173002: Send TextEvent message from Android client (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
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 package org.chromium.chromoting.jni; 5 package org.chromium.chromoting.jni;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.app.AlertDialog; 8 import android.app.AlertDialog;
9 import android.content.Context; 9 import android.content.Context;
10 import android.content.DialogInterface; 10 import android.content.DialogInterface;
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 } 274 }
275 275
276 /** 276 /**
277 * Performs the native response to the user's PIN. 277 * Performs the native response to the user's PIN.
278 * @param pin The entered PIN. 278 * @param pin The entered PIN.
279 * @param createPair Whether to create a new pairing for this client. 279 * @param createPair Whether to create a new pairing for this client.
280 * @param deviceName The device name to appear in the pairing registry. Only used if createPair 280 * @param deviceName The device name to appear in the pairing registry. Only used if createPair
281 * is true. 281 * is true.
282 */ 282 */
283 private static native void nativeAuthenticationResponse(String pin, boolean createPair, 283 private static native void nativeAuthenticationResponse(String pin, boolean createPair,
284 String deviceName); 284 String deviceName);
285 285
286 /** Saves newly-received pairing credentials to permanent storage. Called on the UI thread. */ 286 /** Saves newly-received pairing credentials to permanent storage. Called on the UI thread. */
287 @CalledByNative 287 @CalledByNative
288 private static void commitPairingCredentials(String host, byte[] id, byte[] secret) { 288 private static void commitPairingCredentials(String host, byte[] id, byte[] secret) {
289 sContext.getPreferences(Activity.MODE_PRIVATE).edit(). 289 sContext.getPreferences(Activity.MODE_PRIVATE).edit().
290 putString(host + "_id", new String(id)). 290 putString(host + "_id", new String(id)).
291 putString(host + "_secret", new String(secret)). 291 putString(host + "_secret", new String(secret)).
292 apply(); 292 apply();
293 } 293 }
294 294
295 /** 295 /**
296 * Moves the mouse cursor, possibly while clicking the specified (nonnegativ e) button. Called 296 * Moves the mouse cursor, possibly while clicking the specified (nonnegativ e) button. Called
297 * on the UI thread. 297 * on the UI thread.
298 */ 298 */
299 public static void mouseAction(int x, int y, int whichButton, boolean button Down) { 299 public static void sendMouseEvent(int x, int y, int whichButton, boolean but tonDown) {
300 if (!sConnected) { 300 if (!sConnected) {
301 return; 301 return;
302 } 302 }
303 303
304 nativeMouseAction(x, y, whichButton, buttonDown); 304 nativeSendMouseEvent(x, y, whichButton, buttonDown);
305 } 305 }
306 306
307 /** Passes mouse information to the native handling code. */ 307 /** Passes mouse information to the native handling code. */
308 private static native void nativeMouseAction(int x, int y, int whichButton, boolean buttonDown); 308 private static native void nativeSendMouseEvent(int x, int y, int whichButto n,
309 boolean buttonDown);
309 310
310 /** Injects a mouse-wheel event with delta values. Called on the UI thread. */ 311 /** Injects a mouse-wheel event with delta values. Called on the UI thread. */
311 public static void mouseWheelDeltaAction(int deltaX, int deltaY) { 312 public static void sendMouseWheelEvent(int deltaX, int deltaY) {
312 if (!sConnected) { 313 if (!sConnected) {
313 return; 314 return;
314 } 315 }
315 316
316 nativeMouseWheelDeltaAction(deltaX, deltaY); 317 nativeSendMouseWheelEvent(deltaX, deltaY);
317 } 318 }
318 319
319 /** Passes mouse-wheel information to the native handling code. */ 320 /** Passes mouse-wheel information to the native handling code. */
320 private static native void nativeMouseWheelDeltaAction(int deltaX, int delta Y); 321 private static native void nativeSendMouseWheelEvent(int deltaX, int deltaY) ;
321 322
322 /** Presses and releases the specified (nonnegative) key. Called on the UI t hread. */ 323 /** Presses or releases the specified (nonnegative) key. Called on the UI th read. */
323 public static void keyboardAction(int keyCode, boolean keyDown) { 324 public static void sendKeyEvent(int keyCode, boolean keyDown) {
324 if (!sConnected) { 325 if (!sConnected) {
325 return; 326 return;
326 } 327 }
327 328
328 nativeKeyboardAction(keyCode, keyDown); 329 nativeSendKeyEvent(keyCode, keyDown);
329 } 330 }
330 331
331 /** Passes key press information to the native handling code. */ 332 /** Passes key press information to the native handling code. */
332 private static native void nativeKeyboardAction(int keyCode, boolean keyDown ); 333 private static native void nativeSendKeyEvent(int keyCode, boolean keyDown);
334
335 /** Sends TextEvent to the host. Called on the UI thread. */
336 public static void sendTextEvent(String text) {
337 if (!sConnected) {
338 return;
339 }
340
341 nativeSendTextEvent(text);
342 }
343
344 /** Passes text event information to the native handling code. */
345 private static native void nativeSendTextEvent(String text);
333 346
334 /** 347 /**
335 * Sets the redraw callback to the provided functor. Provide a value of null whenever the 348 * Sets the redraw callback to the provided functor. Provide a value of null whenever the
336 * window is no longer visible so that we don't continue to draw onto it. Ca lled on the UI 349 * window is no longer visible so that we don't continue to draw onto it. Ca lled on the UI
337 * thread. 350 * thread.
338 */ 351 */
339 public static void provideRedrawCallback(Runnable redrawCallback) { 352 public static void provideRedrawCallback(Runnable redrawCallback) {
340 sRedrawCallback = redrawCallback; 353 sRedrawCallback = redrawCallback;
341 } 354 }
342 355
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 buffer.asIntBuffer().get(data, 0, data.length); 427 buffer.asIntBuffer().get(data, 0, data.length);
415 sCursorBitmap = Bitmap.createBitmap(data, width, height, Bitmap.Config.A RGB_8888); 428 sCursorBitmap = Bitmap.createBitmap(data, width, height, Bitmap.Config.A RGB_8888);
416 } 429 }
417 430
418 /** Position of cursor hotspot within cursor image. Called on the graphics t hread. */ 431 /** Position of cursor hotspot within cursor image. Called on the graphics t hread. */
419 public static Point getCursorHotspot() { return sCursorHotspot; } 432 public static Point getCursorHotspot() { return sCursorHotspot; }
420 433
421 /** Returns the current cursor shape. Called on the graphics thread. */ 434 /** Returns the current cursor shape. Called on the graphics thread. */
422 public static Bitmap getCursorBitmap() { return sCursorBitmap; } 435 public static Bitmap getCursorBitmap() { return sCursorBitmap; }
423 } 436 }
OLDNEW
« no previous file with comments | « remoting/android/java/src/org/chromium/chromoting/DesktopView.java ('k') | remoting/client/jni/chromoting_jni_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698