OLD | NEW |
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 // 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // GetAuthenticatedUsername(). Example: to show the string "Signed in as XXX" | 93 // GetAuthenticatedUsername(). Example: to show the string "Signed in as XXX" |
94 // in the hotdog menu. | 94 // in the hotdog menu. |
95 const std::string& GetAuthenticatedAccountId() const; | 95 const std::string& GetAuthenticatedAccountId() const; |
96 | 96 |
97 // Sets the user name. Note: |username| should be already authenticated as | 97 // Sets the user name. Note: |username| should be already authenticated as |
98 // this is a sticky operation (in contrast to StartSignIn). | 98 // this is a sticky operation (in contrast to StartSignIn). |
99 // TODO(tim): Remove this in favor of passing username on construction by | 99 // TODO(tim): Remove this in favor of passing username on construction by |
100 // (by platform / depending on StartBehavior). Bug 88109. | 100 // (by platform / depending on StartBehavior). Bug 88109. |
101 void SetAuthenticatedUsername(const std::string& username); | 101 void SetAuthenticatedUsername(const std::string& username); |
102 | 102 |
| 103 // Returns true if there is an authenticated user. |
| 104 bool IsAuthenticated() const; |
| 105 |
103 // Returns true if there's a signin in progress. | 106 // Returns true if there's a signin in progress. |
104 virtual bool AuthInProgress() const; | 107 virtual bool AuthInProgress() const; |
105 | 108 |
106 // KeyedService implementation. | 109 // KeyedService implementation. |
107 virtual void Shutdown() OVERRIDE; | 110 virtual void Shutdown() OVERRIDE; |
108 | 111 |
109 // Methods to register or remove observers of signin. | 112 // Methods to register or remove observers of signin. |
110 void AddObserver(Observer* observer); | 113 void AddObserver(Observer* observer); |
111 void RemoveObserver(Observer* observer); | 114 void RemoveObserver(Observer* observer); |
112 | 115 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 // The list of SigninDiagnosticObservers. | 150 // The list of SigninDiagnosticObservers. |
148 ObserverList<signin_internals_util::SigninDiagnosticsObserver, true> | 151 ObserverList<signin_internals_util::SigninDiagnosticsObserver, true> |
149 signin_diagnostics_observers_; | 152 signin_diagnostics_observers_; |
150 | 153 |
151 base::WeakPtrFactory<SigninManagerBase> weak_pointer_factory_; | 154 base::WeakPtrFactory<SigninManagerBase> weak_pointer_factory_; |
152 | 155 |
153 DISALLOW_COPY_AND_ASSIGN(SigninManagerBase); | 156 DISALLOW_COPY_AND_ASSIGN(SigninManagerBase); |
154 }; | 157 }; |
155 | 158 |
156 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_MANAGER_BASE_H_ | 159 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_MANAGER_BASE_H_ |
OLD | NEW |