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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // Methods to register or remove SigninDiagnosticObservers. | 118 // Methods to register or remove SigninDiagnosticObservers. |
119 void AddSigninDiagnosticsObserver( | 119 void AddSigninDiagnosticsObserver( |
120 signin_internals_util::SigninDiagnosticsObserver* observer); | 120 signin_internals_util::SigninDiagnosticsObserver* observer); |
121 void RemoveSigninDiagnosticsObserver( | 121 void RemoveSigninDiagnosticsObserver( |
122 signin_internals_util::SigninDiagnosticsObserver* observer); | 122 signin_internals_util::SigninDiagnosticsObserver* observer); |
123 | 123 |
124 protected: | 124 protected: |
125 // Used by subclass to clear authenticated_username_ instead of using | 125 // Used by subclass to clear authenticated_username_ instead of using |
126 // SetAuthenticatedUsername, which enforces special preconditions due | 126 // SetAuthenticatedUsername, which enforces special preconditions due |
127 // to the fact that it is part of the public API and called by clients. | 127 // to the fact that it is part of the public API and called by clients. |
128 void clear_authenticated_username(); | 128 void ClearAuthenticatedUsername(); |
129 | 129 |
130 // List of observers to notify on signin events. | 130 // List of observers to notify on signin events. |
131 // Makes sure list is empty on destruction. | 131 // Makes sure list is empty on destruction. |
132 ObserverList<Observer, true> observer_list_; | 132 ObserverList<Observer, true> observer_list_; |
133 | 133 |
134 // Helper methods to notify all registered diagnostics observers with. | 134 // Helper methods to notify all registered diagnostics observers with. |
135 void NotifyDiagnosticsObservers( | 135 void NotifyDiagnosticsObservers( |
136 const signin_internals_util::UntimedSigninStatusField& field, | 136 const signin_internals_util::UntimedSigninStatusField& field, |
137 const std::string& value); | 137 const std::string& value); |
138 void NotifyDiagnosticsObservers( | 138 void NotifyDiagnosticsObservers( |
139 const signin_internals_util::TimedSigninStatusField& field, | 139 const signin_internals_util::TimedSigninStatusField& field, |
140 const std::string& value); | 140 const std::string& value); |
141 | 141 |
142 private: | 142 private: |
143 friend class FakeSigninManagerBase; | 143 friend class FakeSigninManagerBase; |
144 friend class FakeSigninManager; | 144 friend class FakeSigninManager; |
145 | 145 |
146 SigninClient* client_; | 146 SigninClient* client_; |
147 bool initialized_; | 147 bool initialized_; |
148 | 148 |
149 // Actual username after successful authentication. | 149 // Actual username and account_id after successful authentication. |
150 std::string authenticated_username_; | 150 std::string authenticated_username_; |
| 151 std::string authenticated_account_id_; |
151 | 152 |
152 // The list of SigninDiagnosticObservers. | 153 // The list of SigninDiagnosticObservers. |
153 ObserverList<signin_internals_util::SigninDiagnosticsObserver, true> | 154 ObserverList<signin_internals_util::SigninDiagnosticsObserver, true> |
154 signin_diagnostics_observers_; | 155 signin_diagnostics_observers_; |
155 | 156 |
156 base::WeakPtrFactory<SigninManagerBase> weak_pointer_factory_; | 157 base::WeakPtrFactory<SigninManagerBase> weak_pointer_factory_; |
157 | 158 |
158 DISALLOW_COPY_AND_ASSIGN(SigninManagerBase); | 159 DISALLOW_COPY_AND_ASSIGN(SigninManagerBase); |
159 }; | 160 }; |
160 | 161 |
161 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_MANAGER_BASE_H_ | 162 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_MANAGER_BASE_H_ |
OLD | NEW |