Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/profiles/profile_downloader.h" | 5 #include "chrome/browser/profiles/profile_downloader.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 223 void ProfileDownloader::StartFetchingImage() { | 223 void ProfileDownloader::StartFetchingImage() { |
| 224 VLOG(1) << "Fetching user entry with token: " << auth_token_; | 224 VLOG(1) << "Fetching user entry with token: " << auth_token_; |
| 225 account_info_ = account_tracker_service_->GetAccountInfo(account_id_); | 225 account_info_ = account_tracker_service_->GetAccountInfo(account_id_); |
| 226 | 226 |
| 227 if (delegate_->IsPreSignin()) { | 227 if (delegate_->IsPreSignin()) { |
| 228 AccountFetcherServiceFactory::GetForProfile(delegate_->GetBrowserProfile()) | 228 AccountFetcherServiceFactory::GetForProfile(delegate_->GetBrowserProfile()) |
| 229 ->FetchUserInfoBeforeSignin(account_id_); | 229 ->FetchUserInfoBeforeSignin(account_id_); |
| 230 } | 230 } |
| 231 | 231 |
| 232 if (account_info_.IsValid()) | 232 if (account_info_.IsValid()) |
| 233 FetchImageData(); | 233 FetchImageData(); |
|
Roger Tawa OOO till Jul 10th
2015/09/14 20:03:02
Maybe add comment here and at line 389 that this s
| |
| 234 else | 234 else |
| 235 waiting_for_account_info_ = true; | 235 waiting_for_account_info_ = true; |
| 236 } | 236 } |
| 237 | 237 |
| 238 void ProfileDownloader::StartFetchingOAuth2AccessToken() { | 238 void ProfileDownloader::StartFetchingOAuth2AccessToken() { |
| 239 Profile* profile = delegate_->GetBrowserProfile(); | 239 Profile* profile = delegate_->GetBrowserProfile(); |
| 240 OAuth2TokenService::ScopeSet scopes; | 240 OAuth2TokenService::ScopeSet scopes; |
| 241 scopes.insert(GaiaConstants::kGoogleUserInfoProfile); | 241 scopes.insert(GaiaConstants::kGoogleUserInfoProfile); |
| 242 // Increase scope to get hd attribute to determine if lock should be enabled. | 242 // Increase scope to get hd attribute to determine if lock should be enabled. |
| 243 if (switches::IsNewProfileManagement()) | 243 if (switches::IsNewProfileManagement()) |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 378 this, ProfileDownloaderDelegate::TOKEN_ERROR); | 378 this, ProfileDownloaderDelegate::TOKEN_ERROR); |
| 379 } | 379 } |
| 380 | 380 |
| 381 void ProfileDownloader::OnAccountUpdated(const AccountInfo& info) { | 381 void ProfileDownloader::OnAccountUpdated(const AccountInfo& info) { |
| 382 if (info.account_id == account_id_ && info.IsValid()) { | 382 if (info.account_id == account_id_ && info.IsValid()) { |
| 383 account_info_ = info; | 383 account_info_ = info; |
| 384 | 384 |
| 385 // If the StartFetchingImage was called before we had valid info, the | 385 // If the StartFetchingImage was called before we had valid info, the |
| 386 // downloader has been waiting so we need to fetch the image data now. | 386 // downloader has been waiting so we need to fetch the image data now. |
| 387 if (waiting_for_account_info_) { | 387 if (waiting_for_account_info_) { |
| 388 waiting_for_account_info_ = false; | |
| 388 FetchImageData(); | 389 FetchImageData(); |
| 389 waiting_for_account_info_ = false; | |
| 390 } | 390 } |
| 391 } | 391 } |
| 392 } | 392 } |
| OLD | NEW |