summaryrefslogtreecommitdiffstats
path: root/sync
diff options
context:
space:
mode:
authornyquist@chromium.org <nyquist@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-10 16:01:21 +0000
committernyquist@chromium.org <nyquist@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-10 16:01:21 +0000
commit0caf856931e8710f4ac1ac7a7883cfc488126cbe (patch)
tree3dde4440440b0a603c94b5f29f4daa767c875897 /sync
parent43197ea26c3305cc42ba6a2e231f950bcac1e3d2 (diff)
downloadchromium_src-0caf856931e8710f4ac1ac7a7883cfc488126cbe.zip
chromium_src-0caf856931e8710f4ac1ac7a7883cfc488126cbe.tar.gz
chromium_src-0caf856931e8710f4ac1ac7a7883cfc488126cbe.tar.bz2
Start using OAuth2 for sync cacheinvalidation.
Currently our cacheinvalidation implementation still uses clientlogin. This changes our implementation to instead use OAuth2. This requires the roll to r313 of the cacheinvalidation library. BUG=264503 Review URL: https://chromiumcodereview.appspot.com/22872002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222262 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync')
-rw-r--r--sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java b/sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java
index 7b0abd9..c834085 100644
--- a/sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java
+++ b/sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java
@@ -200,14 +200,13 @@ public class InvalidationService extends AndroidListener {
// Attempt to retrieve a token for the user. This method will also invalidate
// invalidAuthToken if it is non-null.
AccountManagerHelper.get(this).getNewAuthTokenFromForeground(
- account, invalidAuthToken, SyncStatusHelper.AUTH_TOKEN_TYPE_SYNC,
+ account, invalidAuthToken, getOAuth2ScopeWithType(),
new AccountManagerHelper.GetAuthTokenCallback() {
@Override
public void tokenAvailable(String token) {
if (token != null) {
- InvalidationService.setAuthToken(
- InvalidationService.this.getApplicationContext(), pendingIntent,
- token, SyncStatusHelper.AUTH_TOKEN_TYPE_SYNC);
+ setAuthToken(InvalidationService.this.getApplicationContext(),
+ pendingIntent, token, getOAuth2ScopeWithType());
}
}
});
@@ -439,6 +438,10 @@ public class InvalidationService extends AndroidListener {
return sClientId;
}
+ private static String getOAuth2ScopeWithType() {
+ return "oauth2:" + SyncStatusHelper.CHROME_SYNC_OAUTH2_SCOPE;
+ }
+
/** Returns the client name used for the notification client. */
private static byte[] getClientName() {
// TODO(dsmyers): we should use the same client name as the native sync code.