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. When a user is signed in, a ClientLogin | 6 // which user is signed in. When a user is signed in, a ClientLogin |
7 // request is run on their behalf. Auth tokens are fetched from Google | 7 // request is run on their behalf. Auth tokens are fetched from Google |
8 // and the results are stored in the TokenService. | 8 // and the results are stored in the TokenService. |
9 // | 9 // |
10 // **NOTE** on semantics of SigninManager: | 10 // **NOTE** on semantics of SigninManager: |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // ever show it again in this profile (even if the user tries a new account). | 178 // ever show it again in this profile (even if the user tries a new account). |
179 static void DisableOneClickSignIn(Profile* profile); | 179 static void DisableOneClickSignIn(Profile* profile); |
180 | 180 |
181 // GaiaAuthConsumer | 181 // GaiaAuthConsumer |
182 virtual void OnClientLoginSuccess(const ClientLoginResult& result) OVERRIDE; | 182 virtual void OnClientLoginSuccess(const ClientLoginResult& result) OVERRIDE; |
183 virtual void OnClientLoginFailure( | 183 virtual void OnClientLoginFailure( |
184 const GoogleServiceAuthError& error) OVERRIDE; | 184 const GoogleServiceAuthError& error) OVERRIDE; |
185 virtual void OnClientOAuthSuccess(const ClientOAuthResult& result) OVERRIDE; | 185 virtual void OnClientOAuthSuccess(const ClientOAuthResult& result) OVERRIDE; |
186 virtual void OnClientOAuthFailure( | 186 virtual void OnClientOAuthFailure( |
187 const GoogleServiceAuthError& error) OVERRIDE; | 187 const GoogleServiceAuthError& error) OVERRIDE; |
| 188 virtual void OnOAuth2RevokeTokenCompleted() OVERRIDE; |
188 virtual void OnGetUserInfoSuccess(const UserInfoMap& data) OVERRIDE; | 189 virtual void OnGetUserInfoSuccess(const UserInfoMap& data) OVERRIDE; |
189 virtual void OnGetUserInfoFailure( | 190 virtual void OnGetUserInfoFailure( |
190 const GoogleServiceAuthError& error) OVERRIDE; | 191 const GoogleServiceAuthError& error) OVERRIDE; |
191 | 192 |
192 // UbertokenConsumer | 193 // UbertokenConsumer |
193 virtual void OnUbertokenSuccess(const std::string& token) OVERRIDE; | 194 virtual void OnUbertokenSuccess(const std::string& token) OVERRIDE; |
194 virtual void OnUbertokenFailure(const GoogleServiceAuthError& error) OVERRIDE; | 195 virtual void OnUbertokenFailure(const GoogleServiceAuthError& error) OVERRIDE; |
195 | 196 |
196 // content::NotificationObserver | 197 // content::NotificationObserver |
197 virtual void Observe(int type, | 198 virtual void Observe(int type, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 // Will clear in memory data but leaves the db as such so when the browser | 276 // Will clear in memory data but leaves the db as such so when the browser |
276 // restarts we can use the old token(which might throw a password error). | 277 // restarts we can use the old token(which might throw a password error). |
277 void ClearTransientSigninData(); | 278 void ClearTransientSigninData(); |
278 | 279 |
279 // Called to handle an error from a GAIA auth fetch. Sets the last error | 280 // Called to handle an error from a GAIA auth fetch. Sets the last error |
280 // to |error|, sends out a notification of login failure, and clears the | 281 // to |error|, sends out a notification of login failure, and clears the |
281 // transient signin data if |clear_transient_data| is true. | 282 // transient signin data if |clear_transient_data| is true. |
282 void HandleAuthError(const GoogleServiceAuthError& error, | 283 void HandleAuthError(const GoogleServiceAuthError& error, |
283 bool clear_transient_data); | 284 bool clear_transient_data); |
284 | 285 |
| 286 // Called to tell GAIA that we will no longer be using the current refresh |
| 287 // token. |
| 288 void RevokeOAuthLoginToken(); |
| 289 |
285 #if defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS) | 290 #if defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS) |
286 // Callback invoked once policy registration is complete. If registration | 291 // Callback invoked once policy registration is complete. If registration |
287 // fails, |client| will be null. | 292 // fails, |client| will be null. |
288 void OnRegisteredForPolicy(scoped_ptr<policy::CloudPolicyClient> client); | 293 void OnRegisteredForPolicy(scoped_ptr<policy::CloudPolicyClient> client); |
289 | 294 |
290 // Callback invoked when a policy fetch request has completed. |success| is | 295 // Callback invoked when a policy fetch request has completed. |success| is |
291 // true if policy was successfully fetched. | 296 // true if policy was successfully fetched. |
292 void OnPolicyFetchComplete(bool success); | 297 void OnPolicyFetchComplete(bool success); |
293 | 298 |
294 // Called to create a new profile, which is then signed in with the | 299 // Called to create a new profile, which is then signed in with the |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 338 |
334 // Actual client login handler. | 339 // Actual client login handler. |
335 scoped_ptr<GaiaAuthFetcher> client_login_; | 340 scoped_ptr<GaiaAuthFetcher> client_login_; |
336 | 341 |
337 // Registrar for notifications from the TokenService. | 342 // Registrar for notifications from the TokenService. |
338 content::NotificationRegistrar registrar_; | 343 content::NotificationRegistrar registrar_; |
339 | 344 |
340 // UbertokenFetcher to login to user to the web property. | 345 // UbertokenFetcher to login to user to the web property. |
341 scoped_ptr<UbertokenFetcher> ubertoken_fetcher_; | 346 scoped_ptr<UbertokenFetcher> ubertoken_fetcher_; |
342 | 347 |
| 348 // OAuth revocation fetcher for sign outs. |
| 349 scoped_ptr<GaiaAuthFetcher> revoke_token_fetcher_; |
| 350 |
343 // Helper object to listen for changes to signin preferences stored in non- | 351 // Helper object to listen for changes to signin preferences stored in non- |
344 // profile-specific local prefs (like kGoogleServicesUsernamePattern). | 352 // profile-specific local prefs (like kGoogleServicesUsernamePattern). |
345 PrefChangeRegistrar local_state_pref_registrar_; | 353 PrefChangeRegistrar local_state_pref_registrar_; |
346 | 354 |
347 // Helper object to listen for changes to the signin allowed preference. | 355 // Helper object to listen for changes to the signin allowed preference. |
348 BooleanPrefMember signin_allowed_; | 356 BooleanPrefMember signin_allowed_; |
349 | 357 |
350 // Actual username after successful authentication. | 358 // Actual username after successful authentication. |
351 std::string authenticated_username_; | 359 std::string authenticated_username_; |
352 | 360 |
(...skipping 20 matching lines...) Expand all Loading... |
373 #if defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS) | 381 #if defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS) |
374 // CloudPolicyClient reference we keep while determining whether to create | 382 // CloudPolicyClient reference we keep while determining whether to create |
375 // a new profile for an enterprise user or not. | 383 // a new profile for an enterprise user or not. |
376 scoped_ptr<policy::CloudPolicyClient> policy_client_; | 384 scoped_ptr<policy::CloudPolicyClient> policy_client_; |
377 #endif | 385 #endif |
378 | 386 |
379 DISALLOW_COPY_AND_ASSIGN(SigninManager); | 387 DISALLOW_COPY_AND_ASSIGN(SigninManager); |
380 }; | 388 }; |
381 | 389 |
382 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_H_ | 390 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_H_ |
OLD | NEW |