summaryrefslogtreecommitdiffstats
path: root/chrome/android/java
diff options
context:
space:
mode:
authorrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-13 07:38:16 +0000
committerrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-13 07:38:16 +0000
commitbd3093c384c18a559e4449512a85d54d714b1d32 (patch)
tree23ea07fd05278ab7dadab90b948816bb14467392 /chrome/android/java
parentc4e28d2786d3219f78659ac6d788bf540a718d54 (diff)
downloadchromium_src-bd3093c384c18a559e4449512a85d54d714b1d32.zip
chromium_src-bd3093c384c18a559e4449512a85d54d714b1d32.tar.gz
chromium_src-bd3093c384c18a559e4449512a85d54d714b1d32.tar.bz2
Google accounts in android phone do not get pushed into content area. The code already handles several cases correctly:
- when signing to chrome after mirror is enabled, the accounts will be pushed into the content area correctly - if accounts are added while chrome is still running in the background, the accounts will be pushed into the content area correctly The missing case is when the user is already signed in and then updates to the latest version. BUG=381881 TBR=sky@chromium.org Review URL: https://codereview.chromium.org/326723003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276963 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/android/java')
-rw-r--r--chrome/android/java/src/org/chromium/chrome/browser/signin/OAuth2TokenService.java23
1 files changed, 19 insertions, 4 deletions
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/OAuth2TokenService.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/OAuth2TokenService.java
index 9adf0cc..deca8f5 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/OAuth2TokenService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/OAuth2TokenService.java
@@ -20,11 +20,11 @@ import org.chromium.sync.signin.AccountManagerHelper;
import org.chromium.sync.signin.ChromeSigninController;
import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
-import java.util.HashSet;
-import java.util.Set;
import javax.annotation.Nullable;
@@ -42,6 +42,10 @@ public final class OAuth2TokenService {
@VisibleForTesting
public static final String STORED_ACCOUNTS_KEY = "google.services.stored_accounts";
+ /**
+ * Classes that want to listen for refresh token availability should
+ * implement this interface and register with {@link #addObserver}.
+ */
public interface OAuth2TokenServiceObserver {
void onRefreshTokenAvailable(Account account);
void onRefreshTokenRevoked(Account account);
@@ -219,11 +223,21 @@ public final class OAuth2TokenService {
}
}
+ /**
+ * TODO(rogerta): This overload exists until a CL lands in the clank repo to use the
+ * version that takes a boolean second arg.
+ */
public void validateAccounts(Context context) {
+ validateAccounts(context, false);
+ }
+
+ @CalledByNative
+ public void validateAccounts(Context context, boolean forceNotifications) {
ThreadUtils.assertOnUiThread();
String currentlySignedInAccount =
ChromeSigninController.get(context).getSignedInAccountName();
- nativeValidateAccounts(mNativeProfileOAuth2TokenService, currentlySignedInAccount);
+ nativeValidateAccounts(mNativeProfileOAuth2TokenService, currentlySignedInAccount,
+ forceNotifications);
}
/**
@@ -300,7 +314,8 @@ public final class OAuth2TokenService {
String authToken, boolean result, long nativeCallback);
private native void nativeValidateAccounts(
long nativeAndroidProfileOAuth2TokenService,
- String currentlySignedInAccount);
+ String currentlySignedInAccount,
+ boolean forceNotifications);
private native void nativeFireRefreshTokenAvailableFromJava(
long nativeAndroidProfileOAuth2TokenService, String accountName);
private native void nativeFireRefreshTokenRevokedFromJava(