| 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 "content/browser/android/download_controller_android_impl.h" | 5 #include "content/browser/android/download_controller_android_impl.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 | 318 |
| 319 DownloadControllerAndroidImpl::DownloadInfoAndroid::DownloadInfoAndroid( | 319 DownloadControllerAndroidImpl::DownloadInfoAndroid::DownloadInfoAndroid( |
| 320 net::URLRequest* request) { | 320 net::URLRequest* request) { |
| 321 request->GetResponseHeaderByName("content-disposition", &content_disposition); | 321 request->GetResponseHeaderByName("content-disposition", &content_disposition); |
| 322 | 322 |
| 323 if (request->response_headers()) | 323 if (request->response_headers()) |
| 324 request->response_headers()->GetMimeType(&original_mime_type); | 324 request->response_headers()->GetMimeType(&original_mime_type); |
| 325 | 325 |
| 326 request->extra_request_headers().GetHeader( | 326 request->extra_request_headers().GetHeader( |
| 327 net::HttpRequestHeaders::kUserAgent, &user_agent); | 327 net::HttpRequestHeaders::kUserAgent, &user_agent); |
| 328 GURL referer_url(request->GetSanitizedReferrer()); | 328 GURL referer_url(request->referrer()); |
| 329 if (referer_url.is_valid()) | 329 if (referer_url.is_valid()) |
| 330 referer = referer_url.spec(); | 330 referer = referer_url.spec(); |
| 331 if (!request->url_chain().empty()) { | 331 if (!request->url_chain().empty()) { |
| 332 original_url = request->url_chain().front(); | 332 original_url = request->url_chain().front(); |
| 333 url = request->url_chain().back(); | 333 url = request->url_chain().back(); |
| 334 } | 334 } |
| 335 } | 335 } |
| 336 | 336 |
| 337 DownloadControllerAndroidImpl::DownloadInfoAndroid::~DownloadInfoAndroid() {} | 337 DownloadControllerAndroidImpl::DownloadInfoAndroid::~DownloadInfoAndroid() {} |
| 338 | 338 |
| 339 } // namespace content | 339 } // namespace content |
| OLD | NEW |