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; |
11 import android.content.SharedPreferences; | 11 import android.content.SharedPreferences; |
12 import android.graphics.Bitmap; | 12 import android.graphics.Bitmap; |
13 import android.graphics.Point; | 13 import android.graphics.Point; |
14 import android.os.Build; | 14 import android.os.Build; |
15 import android.os.Looper; | 15 import android.os.Looper; |
16 import android.util.Log; | 16 import android.util.Log; |
17 import android.view.KeyEvent; | 17 import android.view.KeyEvent; |
18 import android.view.View; | 18 import android.view.View; |
19 import android.widget.CheckBox; | 19 import android.widget.CheckBox; |
20 import android.widget.TextView; | 20 import android.widget.TextView; |
21 | 21 |
22 import org.chromium.base.CalledByNative; | 22 import org.chromium.base.CalledByNative; |
23 import org.chromium.base.JNINamespace; | 23 import org.chromium.base.JNINamespace; |
24 import org.chromium.chromoting.Chromoting; | |
24 import org.chromium.chromoting.R; | 25 import org.chromium.chromoting.R; |
25 | 26 |
26 import java.nio.ByteBuffer; | 27 import java.nio.ByteBuffer; |
27 import java.nio.ByteOrder; | 28 import java.nio.ByteOrder; |
28 | 29 |
29 /** | 30 /** |
30 * Initializes the Chromium remoting library, and provides JNI calls into it. | 31 * Initializes the Chromium remoting library, and provides JNI calls into it. |
31 * All interaction with the native code is centralized in this class. | 32 * All interaction with the native code is centralized in this class. |
32 */ | 33 */ |
33 @JNINamespace("remoting") | 34 @JNINamespace("remoting") |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
428 sCursorBitmap = Bitmap.createBitmap(data, width, height, Bitmap.Config.A RGB_8888); | 429 sCursorBitmap = Bitmap.createBitmap(data, width, height, Bitmap.Config.A RGB_8888); |
429 } | 430 } |
430 | 431 |
431 /** Position of cursor hotspot within cursor image. Called on the graphics t hread. */ | 432 /** Position of cursor hotspot within cursor image. Called on the graphics t hread. */ |
432 public static Point getCursorHotspot() { return sCursorHotspot; } | 433 public static Point getCursorHotspot() { return sCursorHotspot; } |
433 | 434 |
434 /** Returns the current cursor shape. Called on the graphics thread. */ | 435 /** Returns the current cursor shape. Called on the graphics thread. */ |
435 public static Bitmap getCursorBitmap() { return sCursorBitmap; } | 436 public static Bitmap getCursorBitmap() { return sCursorBitmap; } |
436 | 437 |
437 /** | 438 /** |
438 * Third Party Authentication | 439 * Third Party Authentication |
Sergey Ulanov
2014/06/16 22:55:38
There are two javadoc comments in front of fetchTh
kelvinp
2014/06/17 00:02:57
Done.
| |
439 */ | 440 */ |
441 | |
440 /** Pops up a third party login page to fetch the token required for authent ication.*/ | 442 /** Pops up a third party login page to fetch the token required for authent ication.*/ |
441 @CalledByNative | 443 @CalledByNative |
442 public static void fetchThirdPartyToken(String tokenUrl, String clientId, St ring scope) { | 444 public static void fetchThirdPartyToken(String tokenUrl, String clientId, St ring scope) { |
443 // TODO(kelvinp): Create a intent to fetch the token from the browser | 445 Chromoting app = (Chromoting) sContext; |
444 // (Android Third Party Auth - Part III) | 446 app.fetchThirdPartyToken(tokenUrl, clientId, scope); |
445 } | 447 } |
446 | 448 |
447 /* Notify the native code to continue authentication with the |token| and th e |sharedSecret| */ | 449 /* 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); | 450 public static native void nativeOnThirdPartyTokenFetched(String token, Strin g sharedSecret); |
449 } | 451 } |
OLD | NEW |