| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // The signin manager encapsulates some functionality tracking | 5 // The signin manager encapsulates some functionality tracking |
| 6 // which user is signed in. | 6 // which user is signed in. |
| 7 // | 7 // |
| 8 // **NOTE** on semantics of SigninManager: | 8 // **NOTE** on semantics of SigninManager: |
| 9 // | 9 // |
| 10 // Once a signin is successful, the username becomes "established" and will not | 10 // Once a signin is successful, the username becomes "established" and will not |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 : username(in_username) {} | 59 : username(in_username) {} |
| 60 std::string username; | 60 std::string username; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 class SigninManagerBase : public ProfileKeyedService { | 63 class SigninManagerBase : public ProfileKeyedService { |
| 64 public: | 64 public: |
| 65 SigninManagerBase(); | 65 SigninManagerBase(); |
| 66 virtual ~SigninManagerBase(); | 66 virtual ~SigninManagerBase(); |
| 67 | 67 |
| 68 // If user was signed in, load tokens from DB if available. | 68 // If user was signed in, load tokens from DB if available. |
| 69 virtual void Initialize(Profile* profile); | 69 virtual void Initialize(Profile* profile, PrefService* local_state); |
| 70 bool IsInitialized() const; | 70 bool IsInitialized() const; |
| 71 | 71 |
| 72 // Returns true if a signin to Chrome is allowed (by policy or pref). | 72 // Returns true if a signin to Chrome is allowed (by policy or pref). |
| 73 // TODO(tim): kSigninAllowed is defined for all platforms in pref_names.h. | 73 // TODO(tim): kSigninAllowed is defined for all platforms in pref_names.h. |
| 74 // If kSigninAllowed pref was non-Chrome OS-only, this method wouldn't be | 74 // If kSigninAllowed pref was non-Chrome OS-only, this method wouldn't be |
| 75 // needed, but as is we provide this method to let all interested code | 75 // needed, but as is we provide this method to let all interested code |
| 76 // code query the value in one way, versus half using PrefService directly | 76 // code query the value in one way, versus half using PrefService directly |
| 77 // and the other half using SigninManager. | 77 // and the other half using SigninManager. |
| 78 virtual bool IsSigninAllowed() const; | 78 virtual bool IsSigninAllowed() const; |
| 79 | 79 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // The list of SigninDiagnosticObservers. | 144 // The list of SigninDiagnosticObservers. |
| 145 ObserverList<signin_internals_util::SigninDiagnosticsObserver, true> | 145 ObserverList<signin_internals_util::SigninDiagnosticsObserver, true> |
| 146 signin_diagnostics_observers_; | 146 signin_diagnostics_observers_; |
| 147 | 147 |
| 148 base::WeakPtrFactory<SigninManagerBase> weak_pointer_factory_; | 148 base::WeakPtrFactory<SigninManagerBase> weak_pointer_factory_; |
| 149 | 149 |
| 150 DISALLOW_COPY_AND_ASSIGN(SigninManagerBase); | 150 DISALLOW_COPY_AND_ASSIGN(SigninManagerBase); |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_BASE_H_ | 153 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_BASE_H_ |
| OLD | NEW |