OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chromeos/login/profile_image_downloader.h" | 5 #include "chrome/browser/chromeos/login/profile_image_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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 199 |
200 ProfileImageDownloader::~ProfileImageDownloader() {} | 200 ProfileImageDownloader::~ProfileImageDownloader() {} |
201 | 201 |
202 void ProfileImageDownloader::OnURLFetchComplete( | 202 void ProfileImageDownloader::OnURLFetchComplete( |
203 const content::URLFetcher* source) { | 203 const content::URLFetcher* source) { |
204 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 204 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
205 std::string data; | 205 std::string data; |
206 source->GetResponseAsString(&data); | 206 source->GetResponseAsString(&data); |
207 if (source->GetResponseCode() != 200) { | 207 if (source->GetResponseCode() != 200) { |
208 LOG(ERROR) << "Response code is " << source->GetResponseCode(); | 208 LOG(ERROR) << "Response code is " << source->GetResponseCode(); |
209 LOG(ERROR) << "Url is " << source->GetUrl().spec(); | 209 LOG(ERROR) << "Url is " << source->GetURL().spec(); |
210 LOG(ERROR) << "Data is " << data; | 210 LOG(ERROR) << "Data is " << data; |
211 if (delegate_) | 211 if (delegate_) |
212 delegate_->OnDownloadFailure(); | 212 delegate_->OnDownloadFailure(); |
213 return; | 213 return; |
214 } | 214 } |
215 | 215 |
216 if (source == user_entry_fetcher_.get()) { | 216 if (source == user_entry_fetcher_.get()) { |
217 std::string image_url = GetProfileImageURL(data); | 217 std::string image_url = GetProfileImageURL(data); |
218 if (image_url.empty()) { | 218 if (image_url.empty()) { |
219 if (delegate_) | 219 if (delegate_) |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 } else { | 279 } else { |
280 if (token_details->service() == GaiaConstants::kPicasaService) { | 280 if (token_details->service() == GaiaConstants::kPicasaService) { |
281 LOG(WARNING) << "ProfileImageDownloader: token request failed"; | 281 LOG(WARNING) << "ProfileImageDownloader: token request failed"; |
282 if (delegate_) | 282 if (delegate_) |
283 delegate_->OnDownloadFailure(); | 283 delegate_->OnDownloadFailure(); |
284 } | 284 } |
285 } | 285 } |
286 } | 286 } |
287 | 287 |
288 } // namespace chromeos | 288 } // namespace chromeos |
OLD | NEW |