| 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 #include "components/signin/core/browser/account_reconcilor.h" | 5 #include "components/signin/core/browser/account_reconcilor.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 void AccountReconcilor::OnRefreshTokenRevoked(const std::string& account_id) { | 335 void AccountReconcilor::OnRefreshTokenRevoked(const std::string& account_id) { |
| 336 VLOG(1) << "AccountReconcilor::OnRefreshTokenRevoked: " << account_id; | 336 VLOG(1) << "AccountReconcilor::OnRefreshTokenRevoked: " << account_id; |
| 337 PerformStartRemoveAction(account_id); | 337 PerformStartRemoveAction(account_id); |
| 338 } | 338 } |
| 339 | 339 |
| 340 void AccountReconcilor::OnEndBatchChanges() { | 340 void AccountReconcilor::OnEndBatchChanges() { |
| 341 VLOG(1) << "AccountReconcilor::OnEndBatchChanges"; | 341 VLOG(1) << "AccountReconcilor::OnEndBatchChanges"; |
| 342 StartReconcile(); | 342 StartReconcile(); |
| 343 } | 343 } |
| 344 | 344 |
| 345 void AccountReconcilor::GoogleSigninSucceeded(const std::string& username, | 345 void AccountReconcilor::GoogleSigninSucceeded(const std::string& account_id, |
| 346 const std::string& username, |
| 346 const std::string& password) { | 347 const std::string& password) { |
| 347 VLOG(1) << "AccountReconcilor::GoogleSigninSucceeded: signed in"; | 348 VLOG(1) << "AccountReconcilor::GoogleSigninSucceeded: signed in"; |
| 348 RegisterForCookieChanges(); | 349 RegisterForCookieChanges(); |
| 349 RegisterWithTokenService(); | 350 RegisterWithTokenService(); |
| 350 } | 351 } |
| 351 | 352 |
| 352 void AccountReconcilor::GoogleSignedOut(const std::string& username) { | 353 void AccountReconcilor::GoogleSignedOut(const std::string& account_id, |
| 354 const std::string& username) { |
| 353 VLOG(1) << "AccountReconcilor::GoogleSignedOut: signed out"; | 355 VLOG(1) << "AccountReconcilor::GoogleSignedOut: signed out"; |
| 354 gaia_fetcher_.reset(); | 356 gaia_fetcher_.reset(); |
| 355 get_gaia_accounts_callbacks_.clear(); | 357 get_gaia_accounts_callbacks_.clear(); |
| 356 AbortReconcile(); | 358 AbortReconcile(); |
| 357 UnregisterWithTokenService(); | 359 UnregisterWithTokenService(); |
| 358 UnregisterForCookieChanges(); | 360 UnregisterForCookieChanges(); |
| 359 PerformLogoutAllAccountsAction(); | 361 PerformLogoutAllAccountsAction(); |
| 360 } | 362 } |
| 361 | 363 |
| 362 void AccountReconcilor::PerformMergeAction(const std::string& account_id) { | 364 void AccountReconcilor::PerformMergeAction(const std::string& account_id) { |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 | 799 |
| 798 void AccountReconcilor::HandleRefreshTokenFetched( | 800 void AccountReconcilor::HandleRefreshTokenFetched( |
| 799 const std::string& account_id, | 801 const std::string& account_id, |
| 800 const std::string& refresh_token) { | 802 const std::string& refresh_token) { |
| 801 if (!refresh_token.empty()) | 803 if (!refresh_token.empty()) |
| 802 PerformAddAccountToTokenService(account_id, refresh_token); | 804 PerformAddAccountToTokenService(account_id, refresh_token); |
| 803 | 805 |
| 804 MarkAccountAsAddedToChrome(account_id); | 806 MarkAccountAsAddedToChrome(account_id); |
| 805 CalculateIfReconcileIsDone(); | 807 CalculateIfReconcileIsDone(); |
| 806 } | 808 } |
| OLD | NEW |