| 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/gaia_cookie_manager_service.h" | 5 #include "components/signin/core/browser/gaia_cookie_manager_service.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 GaiaCookieRequestType::LIST_ACCOUNTS); | 554 GaiaCookieRequestType::LIST_ACCOUNTS); |
| 555 fetcher_backoff_.InformOfRequest(true); | 555 fetcher_backoff_.InformOfRequest(true); |
| 556 | 556 |
| 557 if (!gaia::ParseListAccountsData(data, &listed_accounts_)) { | 557 if (!gaia::ParseListAccountsData(data, &listed_accounts_)) { |
| 558 listed_accounts_.clear(); | 558 listed_accounts_.clear(); |
| 559 OnListAccountsFailure(GoogleServiceAuthError( | 559 OnListAccountsFailure(GoogleServiceAuthError( |
| 560 GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE)); | 560 GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE)); |
| 561 return; | 561 return; |
| 562 } | 562 } |
| 563 | 563 |
| 564 for (gaia::ListedAccount account : listed_accounts_) { | 564 for (gaia::ListedAccount& account : listed_accounts_) { |
| 565 DCHECK(account.id.empty()); |
| 565 account.id = AccountTrackerService::PickAccountIdForAccount( | 566 account.id = AccountTrackerService::PickAccountIdForAccount( |
| 566 signin_client_->GetPrefs(), account.gaia_id, account.email); | 567 signin_client_->GetPrefs(), account.gaia_id, account.email); |
| 567 } | 568 } |
| 568 | 569 |
| 569 list_accounts_fetched_once_ = true; | 570 list_accounts_fetched_once_ = true; |
| 570 HandleNextRequest(); | 571 HandleNextRequest(); |
| 571 // HandleNextRequest before sending out the notification because some | 572 // HandleNextRequest before sending out the notification because some |
| 572 // services, in response to OnGaiaAccountsInCookieUpdated, may try in return | 573 // services, in response to OnGaiaAccountsInCookieUpdated, may try in return |
| 573 // to call ListAccounts, which would immediately return false if the | 574 // to call ListAccounts, which would immediately return false if the |
| 574 // ListAccounts request is still sitting in queue. | 575 // ListAccounts request is still sitting in queue. |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 break; | 705 break; |
| 705 case GaiaCookieRequestType::LIST_ACCOUNTS: | 706 case GaiaCookieRequestType::LIST_ACCOUNTS: |
| 706 uber_token_fetcher_.reset(); | 707 uber_token_fetcher_.reset(); |
| 707 signin_client_->DelayNetworkCall( | 708 signin_client_->DelayNetworkCall( |
| 708 base::Bind(&GaiaCookieManagerService::StartFetchingListAccounts, | 709 base::Bind(&GaiaCookieManagerService::StartFetchingListAccounts, |
| 709 base::Unretained(this))); | 710 base::Unretained(this))); |
| 710 break; | 711 break; |
| 711 }; | 712 }; |
| 712 } | 713 } |
| 713 } | 714 } |
| OLD | NEW |