| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_fetcher_service.h" | 5 #include "components/signin/core/browser/account_fetcher_service.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 shutdown_called_ = true; | 98 shutdown_called_ = true; |
| 99 } | 99 } |
| 100 | 100 |
| 101 void AccountFetcherService::EnableNetworkFetches() { | 101 void AccountFetcherService::EnableNetworkFetches() { |
| 102 DCHECK(CalledOnValidThread()); | 102 DCHECK(CalledOnValidThread()); |
| 103 DCHECK(!network_fetches_enabled_); | 103 DCHECK(!network_fetches_enabled_); |
| 104 network_fetches_enabled_ = true; | 104 network_fetches_enabled_ = true; |
| 105 // If there are accounts in |pending_user_info_fetches_|, they were deemed | 105 // If there are accounts in |pending_user_info_fetches_|, they were deemed |
| 106 // invalid after being loaded from prefs and need to be fetched now instead of | 106 // invalid after being loaded from prefs and need to be fetched now instead of |
| 107 // waiting after the timer. | 107 // waiting after the timer. |
| 108 for (std::string account_id : pending_user_info_fetches_) | 108 for (const std::string& account_id : pending_user_info_fetches_) |
| 109 StartFetchingUserInfo(account_id); | 109 StartFetchingUserInfo(account_id); |
| 110 pending_user_info_fetches_.clear(); | 110 pending_user_info_fetches_.clear(); |
| 111 | 111 |
| 112 // Now that network fetches are enabled, schedule the next refresh. | 112 // Now that network fetches are enabled, schedule the next refresh. |
| 113 ScheduleNextRefresh(); | 113 ScheduleNextRefresh(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 bool AccountFetcherService::IsAllUserInfoFetched() const { | 116 bool AccountFetcherService::IsAllUserInfoFetched() const { |
| 117 return user_info_requests_.empty(); | 117 return user_info_requests_.empty(); |
| 118 } | 118 } |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 UpdateChildInfo(); | 313 UpdateChildInfo(); |
| 314 account_tracker_service_->StopTrackingAccount(account_id); | 314 account_tracker_service_->StopTrackingAccount(account_id); |
| 315 } | 315 } |
| 316 | 316 |
| 317 void AccountFetcherService::OnRefreshTokensLoaded() { | 317 void AccountFetcherService::OnRefreshTokensLoaded() { |
| 318 // OnRefreshTokenAvailable has been called for all accounts by this point. | 318 // OnRefreshTokenAvailable has been called for all accounts by this point. |
| 319 // Maybe remove this after further investigation. | 319 // Maybe remove this after further investigation. |
| 320 RefreshAllAccountInfo(true); | 320 RefreshAllAccountInfo(true); |
| 321 UpdateChildInfo(); | 321 UpdateChildInfo(); |
| 322 } | 322 } |
| OLD | NEW |