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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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); |
105 source->GetResponseAsString(data.get()); | 105 source->GetResponseAsString(data.get()); |
106 callback_.Run(code, data.Pass()); | 106 callback_.Run(code, data.Pass()); |
107 OnProcessURLFetchResultsComplete(code == HTTP_SUCCESS); | 107 OnProcessURLFetchResultsComplete(); |
108 } | 108 } |
109 | 109 |
110 void GetContactPhotoRequest::RunCallbackOnPrematureFailure( | 110 void GetContactPhotoRequest::RunCallbackOnPrematureFailure( |
111 GDataErrorCode code) { | 111 GDataErrorCode code) { |
112 scoped_ptr<std::string> data(new std::string); | 112 scoped_ptr<std::string> data(new std::string); |
113 callback_.Run(code, data.Pass()); | 113 callback_.Run(code, data.Pass()); |
114 } | 114 } |
115 | 115 |
116 } // namespace google_apis | 116 } // namespace google_apis |
OLD | NEW |