OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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.accounts.Account; | 7 import android.accounts.Account; |
| 8 import android.annotation.SuppressLint; |
8 import android.app.Activity; | 9 import android.app.Activity; |
9 import android.content.Context; | 10 import android.content.Context; |
10 import android.os.Handler; | 11 import android.os.Handler; |
11 | 12 |
12 import org.chromium.base.ActivityState; | 13 import org.chromium.base.ActivityState; |
13 import org.chromium.base.ApiCompatibilityUtils; | 14 import org.chromium.base.ApiCompatibilityUtils; |
14 import org.chromium.base.ApplicationStatus; | 15 import org.chromium.base.ApplicationStatus; |
15 import org.chromium.base.Callback; | 16 import org.chromium.base.Callback; |
16 import org.chromium.base.Log; | 17 import org.chromium.base.Log; |
17 import org.chromium.base.ObserverList; | 18 import org.chromium.base.ObserverList; |
(...skipping 18 matching lines...) Expand all Loading... |
36 * This class handles common paths during the sign-in and sign-out flows. | 37 * This class handles common paths during the sign-in and sign-out flows. |
37 * <p/> | 38 * <p/> |
38 * Only usable from the UI thread as the native SigninManager requires its acces
s to be in the | 39 * Only usable from the UI thread as the native SigninManager requires its acces
s to be in the |
39 * UI thread. | 40 * UI thread. |
40 * <p/> | 41 * <p/> |
41 * See chrome/browser/signin/signin_manager_android.h for more details. | 42 * See chrome/browser/signin/signin_manager_android.h for more details. |
42 */ | 43 */ |
43 public class SigninManager implements AccountTrackerService.OnSystemAccountsSeed
edListener { | 44 public class SigninManager implements AccountTrackerService.OnSystemAccountsSeed
edListener { |
44 private static final String TAG = "SigninManager"; | 45 private static final String TAG = "SigninManager"; |
45 | 46 |
| 47 @SuppressLint("StaticFieldLeak") |
46 private static SigninManager sSigninManager; | 48 private static SigninManager sSigninManager; |
47 private static int sSignInAccessPoint = SigninAccessPoint.UNKNOWN; | 49 private static int sSignInAccessPoint = SigninAccessPoint.UNKNOWN; |
48 | 50 |
49 private final Context mContext; | 51 private final Context mContext; |
50 private final long mNativeSigninManagerAndroid; | 52 private final long mNativeSigninManagerAndroid; |
51 | 53 |
52 /** Tracks whether the First Run check has been completed. | 54 /** Tracks whether the First Run check has been completed. |
53 * | 55 * |
54 * A new sign-in can not be started while this is pending, to prevent the | 56 * A new sign-in can not be started while this is pending, to prevent the |
55 * pending check from eventually starting a 2nd sign-in. | 57 * pending check from eventually starting a 2nd sign-in. |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 private native void nativeOnSignInCompleted(long nativeSigninManagerAndroid,
String username); | 678 private native void nativeOnSignInCompleted(long nativeSigninManagerAndroid,
String username); |
677 private native void nativeSignOut(long nativeSigninManagerAndroid); | 679 private native void nativeSignOut(long nativeSigninManagerAndroid); |
678 private native String nativeGetManagementDomain(long nativeSigninManagerAndr
oid); | 680 private native String nativeGetManagementDomain(long nativeSigninManagerAndr
oid); |
679 private native void nativeWipeProfileData(long nativeSigninManagerAndroid, W
ipeDataHooks hooks); | 681 private native void nativeWipeProfileData(long nativeSigninManagerAndroid, W
ipeDataHooks hooks); |
680 private native void nativeClearLastSignedInUser(long nativeSigninManagerAndr
oid); | 682 private native void nativeClearLastSignedInUser(long nativeSigninManagerAndr
oid); |
681 private native void nativeLogInSignedInUser(long nativeSigninManagerAndroid)
; | 683 private native void nativeLogInSignedInUser(long nativeSigninManagerAndroid)
; |
682 private native boolean nativeIsSignedInOnNative(long nativeSigninManagerAndr
oid); | 684 private native boolean nativeIsSignedInOnNative(long nativeSigninManagerAndr
oid); |
683 private native void nativeProhibitSignout( | 685 private native void nativeProhibitSignout( |
684 long nativeSigninManagerAndroid, boolean prohibitSignout); | 686 long nativeSigninManagerAndroid, boolean prohibitSignout); |
685 } | 687 } |
OLD | NEW |