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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/signin/AndroidProfileOAuth2TokenServiceHelper.java

Issue 23382008: Making OAuth2TokenService multi-login aware, updating callers, minor fixes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing to include the update to ProfileSyncService: r224220 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/app_mode/startup_app_launcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/signin/AndroidProfileOAuth2TokenServiceHelper.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/AndroidProfileOAuth2TokenServiceHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/AndroidProfileOAuth2TokenServiceHelper.java
index 7e0582dda22cc351eb77fd838e2c9ba619954b86..09d73a14b8ffe22a6b168b4c70705d6e742165a1 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/AndroidProfileOAuth2TokenServiceHelper.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/AndroidProfileOAuth2TokenServiceHelper.java
@@ -51,6 +51,16 @@ public final class AndroidProfileOAuth2TokenServiceHelper {
}
/**
+ * Called by native to list the accounts with OAuth2 refresh tokens.
+ */
+ @CalledByNative
+ public static String[] getAccounts(Context context) {
+ AccountManagerHelper accountManagerHelper = AccountManagerHelper.get(context);
+ java.util.List<String> accountNames = accountManagerHelper.getGoogleAccountNames();
+ return accountNames.toArray(new String[accountNames.size()]);
+ }
+
+ /**
* Called by native to retrieve OAuth2 tokens.
*
* @param username The native username (full address).
@@ -136,6 +146,14 @@ public final class AndroidProfileOAuth2TokenServiceHelper {
}
/**
+ * Called by native to check wether the account has an OAuth2 refresh token.
+ */
+ @CalledByNative
+ public static boolean hasOAuth2RefreshToken(Context context, String accountName) {
+ return AccountManagerHelper.get(context).hasAccountForName(accountName);
+ }
+
+ /**
* Called by native to invalidate an OAuth2 token.
*/
@CalledByNative
« no previous file with comments | « no previous file | chrome/browser/chromeos/app_mode/startup_app_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698