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

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

Issue 2784353002: Android: Remove GetApplicationContext part 2 (Closed)
Patch Set: Fix tests Created 3 years, 8 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
Index: chrome/android/java/src/org/chromium/chrome/browser/signin/AccountIdProvider.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountIdProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountIdProvider.java
index 423409da02eae5e19f6b971f2c62a95ed30e79f1..15a8b0abe33a0676840c5db056972163d5d13181 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountIdProvider.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountIdProvider.java
@@ -4,11 +4,10 @@
package org.chromium.chrome.browser.signin;
-import android.content.Context;
-
import com.google.android.gms.auth.GoogleAuthException;
import com.google.android.gms.auth.GoogleAuthUtil;
+import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.ThreadUtils;
import org.chromium.base.VisibleForTesting;
@@ -39,9 +38,9 @@ public class AccountIdProvider {
*
* @param accountName The email address of a Google account.
*/
- public String getAccountId(Context ctx, String accountName) {
+ public String getAccountId(String accountName) {
try {
- return GoogleAuthUtil.getAccountId(ctx, accountName);
+ return GoogleAuthUtil.getAccountId(ContextUtils.getApplicationContext(), accountName);
} catch (IOException | GoogleAuthException ex) {
Log.e("cr.AccountIdProvider", "AccountIdProvider.getAccountId", ex);
return null;
@@ -53,9 +52,9 @@ public class AccountIdProvider {
* Since the AccountIdProvider queries Google Play services, this basically checks whether
* Google Play services is available.
*/
- public boolean canBeUsed(Context ctx) {
+ public boolean canBeUsed() {
return ExternalAuthUtils.getInstance().canUseGooglePlayServices(
- ctx, new UserRecoverableErrorHandler.Silent());
+ ContextUtils.getApplicationContext(), new UserRecoverableErrorHandler.Silent());
}
/**

Powered by Google App Engine
This is Rietveld 408576698