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

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

Issue 337013002: Third Party Authentication for Android Part III - Android OAuth2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix indentation Created 6 years, 6 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
« no previous file with comments | « remoting/android/java/src/org/chromium/chromoting/ThirdPartyTokenFetcher.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 buffer.asIntBuffer().get(data, 0, data.length); 428 buffer.asIntBuffer().get(data, 0, data.length);
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
439 */ 440 //
440 /** Pops up a third party login page to fetch the token required for authent ication.*/ 441
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 /**
450 * Notify the native code to continue authentication with the |token| and th e |sharedSecret|.
451 */
448 public static native void nativeOnThirdPartyTokenFetched(String token, Strin g sharedSecret); 452 public static native void nativeOnThirdPartyTokenFetched(String token, Strin g sharedSecret);
449 } 453 }
OLDNEW
« no previous file with comments | « remoting/android/java/src/org/chromium/chromoting/ThirdPartyTokenFetcher.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698