OLD | NEW |
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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 return; | 314 return; |
315 } | 315 } |
316 | 316 |
317 nativeSendMouseWheelEvent(deltaX, deltaY); | 317 nativeSendMouseWheelEvent(deltaX, deltaY); |
318 } | 318 } |
319 | 319 |
320 /** Passes mouse-wheel information to the native handling code. */ | 320 /** Passes mouse-wheel information to the native handling code. */ |
321 private static native void nativeSendMouseWheelEvent(int deltaX, int deltaY)
; | 321 private static native void nativeSendMouseWheelEvent(int deltaX, int deltaY)
; |
322 | 322 |
323 /** Presses or releases the specified (nonnegative) key. Called on the UI th
read. */ | 323 /** Presses or releases the specified (nonnegative) key. Called on the UI th
read. */ |
324 public static void sendKeyEvent(int keyCode, boolean keyDown) { | 324 public static boolean sendKeyEvent(int keyCode, boolean keyDown) { |
325 if (!sConnected) { | 325 if (!sConnected) { |
326 return; | 326 return false; |
327 } | 327 } |
328 | 328 |
329 nativeSendKeyEvent(keyCode, keyDown); | 329 return nativeSendKeyEvent(keyCode, keyDown); |
330 } | 330 } |
331 | 331 |
332 /** Passes key press information to the native handling code. */ | 332 /** Passes key press information to the native handling code. */ |
333 private static native void nativeSendKeyEvent(int keyCode, boolean keyDown); | 333 private static native boolean nativeSendKeyEvent(int keyCode, boolean keyDow
n); |
334 | 334 |
335 /** Sends TextEvent to the host. Called on the UI thread. */ | 335 /** Sends TextEvent to the host. Called on the UI thread. */ |
336 public static void sendTextEvent(String text) { | 336 public static void sendTextEvent(String text) { |
337 if (!sConnected) { | 337 if (!sConnected) { |
338 return; | 338 return; |
339 } | 339 } |
340 | 340 |
341 nativeSendTextEvent(text); | 341 nativeSendTextEvent(text); |
342 } | 342 } |
343 | 343 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 /** Pops up a third party login page to fetch the token required for authent
ication.*/ | 440 /** Pops up a third party login page to fetch the token required for authent
ication.*/ |
441 @CalledByNative | 441 @CalledByNative |
442 public static void fetchThirdPartyToken(String tokenUrl, String clientId, St
ring scope) { | 442 public static void fetchThirdPartyToken(String tokenUrl, String clientId, St
ring scope) { |
443 // TODO(kelvinp): Create a intent to fetch the token from the browser | 443 // TODO(kelvinp): Create a intent to fetch the token from the browser |
444 // (Android Third Party Auth - Part III) | 444 // (Android Third Party Auth - Part III) |
445 } | 445 } |
446 | 446 |
447 /* Notify the native code to continue authentication with the |token| and th
e |sharedSecret| */ | 447 /* Notify the native code to continue authentication with the |token| and th
e |sharedSecret| */ |
448 public static native void nativeOnThirdPartyTokenFetched(String token, Strin
g sharedSecret); | 448 public static native void nativeOnThirdPartyTokenFetched(String token, Strin
g sharedSecret); |
449 } | 449 } |
OLD | NEW |