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

Side by Side Diff: sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.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 unified diff | Download patch
« no previous file with comments | « google_apis/gaia/oauth2_token_service_unittest.cc ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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.sync.signin; 5 package org.chromium.sync.signin;
6 6
7 7
8 import com.google.common.annotations.VisibleForTesting; 8 import com.google.common.annotations.VisibleForTesting;
9 9
10 import android.accounts.Account; 10 import android.accounts.Account;
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 Account[] accounts = mAccountManager.getAccountsByType(GOOGLE_ACCOUNT_TY PE); 129 Account[] accounts = mAccountManager.getAccountsByType(GOOGLE_ACCOUNT_TY PE);
130 for (Account account : accounts) { 130 for (Account account : accounts) {
131 if (account.name.equals(accountName)) { 131 if (account.name.equals(accountName)) {
132 return account; 132 return account;
133 } 133 }
134 } 134 }
135 return null; 135 return null;
136 } 136 }
137 137
138 /** 138 /**
139 * Returns whether the accounts exists.
140 */
141 public boolean hasAccountForName(String accountName) {
142 return getAccountFromName(accountName) != null;
143 }
144
145 /**
139 * @return Whether or not there is an account authenticator for Google accou nts. 146 * @return Whether or not there is an account authenticator for Google accou nts.
140 */ 147 */
141 public boolean hasGoogleAccountAuthenticator() { 148 public boolean hasGoogleAccountAuthenticator() {
142 AuthenticatorDescription[] descs = mAccountManager.getAuthenticatorTypes (); 149 AuthenticatorDescription[] descs = mAccountManager.getAuthenticatorTypes ();
143 for (AuthenticatorDescription desc : descs) { 150 for (AuthenticatorDescription desc : descs) {
144 if (GOOGLE_ACCOUNT_TYPE.equals(desc.type)) return true; 151 if (GOOGLE_ACCOUNT_TYPE.equals(desc.type)) return true;
145 } 152 }
146 return false; 153 return false;
147 } 154 }
148 155
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 null, account, authTokenType, callback, numTries, errorEncountered, null); 343 null, account, authTokenType, callback, numTries, errorEncountered, null);
337 } 344 }
338 345
339 /** 346 /**
340 * Removes an auth token from the AccountManager's cache. 347 * Removes an auth token from the AccountManager's cache.
341 */ 348 */
342 public void invalidateAuthToken(String authToken) { 349 public void invalidateAuthToken(String authToken) {
343 mAccountManager.invalidateAuthToken(GOOGLE_ACCOUNT_TYPE, authToken); 350 mAccountManager.invalidateAuthToken(GOOGLE_ACCOUNT_TYPE, authToken);
344 } 351 }
345 } 352 }
OLDNEW
« no previous file with comments | « google_apis/gaia/oauth2_token_service_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698