| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/google_apis/gdata_contacts_requests.h" | 5 #include "chrome/browser/google_apis/gdata_contacts_requests.h" |
| 6 | 6 |
| 7 #include "chrome/browser/google_apis/time_util.h" | 7 #include "chrome/browser/google_apis/time_util.h" |
| 8 #include "net/base/url_util.h" | 8 #include "net/base/url_util.h" |
| 9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
| 10 | 10 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 GetContactPhotoRequest::~GetContactPhotoRequest() {} | 95 GetContactPhotoRequest::~GetContactPhotoRequest() {} |
| 96 | 96 |
| 97 GURL GetContactPhotoRequest::GetURL() const { | 97 GURL GetContactPhotoRequest::GetURL() const { |
| 98 return photo_url_; | 98 return photo_url_; |
| 99 } | 99 } |
| 100 | 100 |
| 101 void GetContactPhotoRequest::ProcessURLFetchResults( | 101 void GetContactPhotoRequest::ProcessURLFetchResults( |
| 102 const net::URLFetcher* source) { | 102 const net::URLFetcher* source) { |
| 103 GDataErrorCode code = GetErrorCode(source); | 103 GDataErrorCode code = GetErrorCode(source); |
| 104 scoped_ptr<std::string> data(new std::string); | 104 scoped_ptr<std::string> data(new std::string(response_writer()->data())); |
| 105 source->GetResponseAsString(data.get()); | |
| 106 callback_.Run(code, data.Pass()); | 105 callback_.Run(code, data.Pass()); |
| 107 OnProcessURLFetchResultsComplete(); | 106 OnProcessURLFetchResultsComplete(); |
| 108 } | 107 } |
| 109 | 108 |
| 110 void GetContactPhotoRequest::RunCallbackOnPrematureFailure( | 109 void GetContactPhotoRequest::RunCallbackOnPrematureFailure( |
| 111 GDataErrorCode code) { | 110 GDataErrorCode code) { |
| 112 scoped_ptr<std::string> data(new std::string); | 111 scoped_ptr<std::string> data(new std::string); |
| 113 callback_.Run(code, data.Pass()); | 112 callback_.Run(code, data.Pass()); |
| 114 } | 113 } |
| 115 | 114 |
| 116 } // namespace google_apis | 115 } // namespace google_apis |
| OLD | NEW |