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

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

Issue 1553713002: rm notification about lack of Google Play Services (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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.chrome.browser.signin; 5 package org.chromium.chrome.browser.signin;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.content.Context; 8 import android.content.Context;
9 9
10 import com.google.android.gms.auth.GoogleAuthException; 10 import com.google.android.gms.auth.GoogleAuthException;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 return null; 50 return null;
51 } 51 }
52 } 52 }
53 53
54 /** 54 /**
55 * Returns whether the AccountIdProvider can be used. 55 * Returns whether the AccountIdProvider can be used.
56 * Since the AccountIdProvider queries Google Play services, this basically checks whether 56 * Since the AccountIdProvider queries Google Play services, this basically checks whether
57 * Google Play services is available. 57 * Google Play services is available.
58 * 58 *
59 * @param activity If an activity is provided, it will be used to show a Mod al Dialog notifying 59 * @param activity If an activity is provided, it will be used to show a Mod al Dialog notifying
60 * the user to update Google Play services, else a System notification is sh own. 60 * the user to update Google Play services, else a System notification is sh own.
Ian Wen 2016/01/04 03:55:31 You should update this javadoc as well.
61 */ 61 */
62 public boolean canBeUsed(Context ctx, @Nullable Activity activity) { 62 public boolean canBeUsed(Context ctx, @Nullable Activity activity) {
63 UserRecoverableErrorHandler errorHandler = activity != null 63 return ExternalAuthUtils.getInstance().canUseGooglePlayServices(ctx,
64 ? new UserRecoverableErrorHandler.ModalDialog(activity) 64 new UserRecoverableErrorHandler.Silent());
65 : new UserRecoverableErrorHandler.SystemNotification();
66 return ExternalAuthUtils.getInstance().canUseGooglePlayServices(ctx, err orHandler);
67 } 65 }
68 66
69 /** 67 /**
70 * Gets the global account Id provider. 68 * Gets the global account Id provider.
71 */ 69 */
72 public static AccountIdProvider getInstance() { 70 public static AccountIdProvider getInstance() {
73 ThreadUtils.assertOnUiThread(); 71 ThreadUtils.assertOnUiThread();
74 if (sProvider == null) sProvider = new AccountIdProvider(); 72 if (sProvider == null) sProvider = new AccountIdProvider();
75 return sProvider; 73 return sProvider;
76 } 74 }
77 75
78 /** 76 /**
79 * For testing purposes only, allows to set the provider even if it has alre ady been 77 * For testing purposes only, allows to set the provider even if it has alre ady been
80 * initialized. 78 * initialized.
81 */ 79 */
82 @VisibleForTesting 80 @VisibleForTesting
83 public static void setInstanceForTest(AccountIdProvider provider) { 81 public static void setInstanceForTest(AccountIdProvider provider) {
84 ThreadUtils.assertOnUiThread(); 82 ThreadUtils.assertOnUiThread();
85 sProvider = provider; 83 sProvider = provider;
86 } 84 }
87 } 85 }
88 86
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698