OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.blimp.auth; | 5 package org.chromium.blimp.app.auth; |
6 | 6 |
7 import android.accounts.Account; | 7 import android.accounts.Account; |
8 import android.accounts.AccountManager; | 8 import android.accounts.AccountManager; |
9 import android.content.Context; | 9 import android.content.Context; |
10 import android.content.Intent; | 10 import android.content.Intent; |
11 import android.content.SharedPreferences; | 11 import android.content.SharedPreferences; |
12 import android.os.AsyncTask; | 12 import android.os.AsyncTask; |
13 | 13 |
14 import com.google.android.gms.auth.GoogleAuthException; | 14 import com.google.android.gms.auth.GoogleAuthException; |
15 import com.google.android.gms.auth.GoogleAuthUtil; | 15 import com.google.android.gms.auth.GoogleAuthUtil; |
16 import com.google.android.gms.auth.GooglePlayServicesAvailabilityException; | 16 import com.google.android.gms.auth.GooglePlayServicesAvailabilityException; |
17 import com.google.android.gms.auth.UserRecoverableNotifiedException; | 17 import com.google.android.gms.auth.UserRecoverableNotifiedException; |
18 import com.google.android.gms.common.ConnectionResult; | 18 import com.google.android.gms.common.ConnectionResult; |
19 | 19 |
20 import org.chromium.base.ContextUtils; | 20 import org.chromium.base.ContextUtils; |
21 import org.chromium.base.Log; | 21 import org.chromium.base.Log; |
22 import org.chromium.base.ThreadUtils; | 22 import org.chromium.base.ThreadUtils; |
23 import org.chromium.blimp.R; | 23 import org.chromium.blimp.app.R; |
24 | 24 |
25 import java.io.IOException; | 25 import java.io.IOException; |
26 import java.util.concurrent.atomic.AtomicBoolean; | 26 import java.util.concurrent.atomic.AtomicBoolean; |
27 | 27 |
28 /** | 28 /** |
29 * An implementation of TokenSource that handles querying {@link GoogleAuthUtil}
for a valid | 29 * An implementation of TokenSource that handles querying {@link GoogleAuthUtil}
for a valid |
30 * authentication token for a particular user account. The user account will be
saved as an | 30 * authentication token for a particular user account. The user account will be
saved as an |
31 * application preference once set. See {@link TokenSource} for information on
how callers know | 31 * application preference once set. See {@link TokenSource} for information on
how callers know |
32 * whether or not an account is set and how they set one. | 32 * whether or not an account is set and how they set one. |
33 */ | 33 */ |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 175 |
176 if (token == null) { | 176 if (token == null) { |
177 mCallback.onTokenUnavailable(mIsRecoverable.get()); | 177 mCallback.onTokenUnavailable(mIsRecoverable.get()); |
178 } else { | 178 } else { |
179 mCallback.onTokenReceived(token); | 179 mCallback.onTokenReceived(token); |
180 } | 180 } |
181 if (mTokenQueryTask == TokenQueryTask.this) mTokenQueryTask = null; | 181 if (mTokenQueryTask == TokenQueryTask.this) mTokenQueryTask = null; |
182 } | 182 } |
183 } | 183 } |
184 } | 184 } |
OLD | NEW |