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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 ClearAuthenticatedUsername(); | 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 method to notify all registered diagnostics observers with. |
135 void NotifyDiagnosticsObservers( | |
136 const signin_internals_util::UntimedSigninStatusField& field, | |
137 const std::string& value); | |
138 void NotifyDiagnosticsObservers( | 135 void NotifyDiagnosticsObservers( |
139 const signin_internals_util::TimedSigninStatusField& field, | 136 const signin_internals_util::TimedSigninStatusField& field, |
140 const std::string& value); | 137 const std::string& value); |
141 | 138 |
142 private: | 139 private: |
143 friend class FakeSigninManagerBase; | 140 friend class FakeSigninManagerBase; |
144 friend class FakeSigninManager; | 141 friend class FakeSigninManager; |
145 | 142 |
146 SigninClient* client_; | 143 SigninClient* client_; |
147 bool initialized_; | 144 bool initialized_; |
148 | 145 |
149 // Actual username and account_id after successful authentication. | 146 // Actual username and account_id after successful authentication. |
150 std::string authenticated_username_; | 147 std::string authenticated_username_; |
151 std::string authenticated_account_id_; | 148 std::string authenticated_account_id_; |
152 | 149 |
153 // The list of SigninDiagnosticObservers. | 150 // The list of SigninDiagnosticObservers. |
154 ObserverList<signin_internals_util::SigninDiagnosticsObserver, true> | 151 ObserverList<signin_internals_util::SigninDiagnosticsObserver, true> |
155 signin_diagnostics_observers_; | 152 signin_diagnostics_observers_; |
156 | 153 |
157 base::WeakPtrFactory<SigninManagerBase> weak_pointer_factory_; | 154 base::WeakPtrFactory<SigninManagerBase> weak_pointer_factory_; |
158 | 155 |
159 DISALLOW_COPY_AND_ASSIGN(SigninManagerBase); | 156 DISALLOW_COPY_AND_ASSIGN(SigninManagerBase); |
160 }; | 157 }; |
161 | 158 |
162 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_MANAGER_BASE_H_ | 159 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_MANAGER_BASE_H_ |
OLD | NEW |