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 "content/browser/download/download_resource_handler.h" | 5 #include "content/browser/download/download_resource_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 CallStartedCB(net::OK); | 122 CallStartedCB(net::OK); |
123 | 123 |
124 std::string content_type_header; | 124 std::string content_type_header; |
125 if (!response->headers || | 125 if (!response->headers || |
126 !response->headers->GetMimeType(&content_type_header)) | 126 !response->headers->GetMimeType(&content_type_header)) |
127 content_type_header = ""; | 127 content_type_header = ""; |
128 info->original_mime_type = content_type_header; | 128 info->original_mime_type = content_type_header; |
129 | 129 |
130 if (!response->headers || | 130 if (!response->headers || |
131 !response->headers->EnumerateHeader(NULL, | 131 !response->headers->EnumerateHeader(NULL, |
132 "Accepts-Ranges", | 132 "Accept-Ranges", |
133 &accepts_ranges_)) { | 133 &accepts_ranges_)) { |
cbentzel
2011/11/30 18:51:01
Nit: accept_ranges_ for the member name?
ahendrickson
2011/11/30 19:33:51
Changed.
| |
134 accepts_ranges_ = ""; | 134 accepts_ranges_ = ""; |
135 } | 135 } |
136 | 136 |
137 info->prompt_user_for_save_location = | 137 info->prompt_user_for_save_location = |
138 save_as_ && save_info_.file_path.empty(); | 138 save_as_ && save_info_.file_path.empty(); |
139 info->referrer_charset = request_->context()->referrer_charset(); | 139 info->referrer_charset = request_->context()->referrer_charset(); |
140 info->save_info = save_info_; | 140 info->save_info = save_info_; |
141 BrowserThread::PostTask( | 141 BrowserThread::PostTask( |
142 BrowserThread::UI, FROM_HERE, | 142 BrowserThread::UI, FROM_HERE, |
143 base::Bind(&DownloadFileManager::StartDownload, | 143 base::Bind(&DownloadFileManager::StartDownload, |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
323 " render_view_id_ = " "%d" | 323 " render_view_id_ = " "%d" |
324 " save_info_.file_path = \"%" PRFilePath "\"" | 324 " save_info_.file_path = \"%" PRFilePath "\"" |
325 " }", | 325 " }", |
326 request_->url().spec().c_str(), | 326 request_->url().spec().c_str(), |
327 download_id_.local(), | 327 download_id_.local(), |
328 global_id_.child_id, | 328 global_id_.child_id, |
329 global_id_.request_id, | 329 global_id_.request_id, |
330 render_view_id_, | 330 render_view_id_, |
331 save_info_.file_path.value().c_str()); | 331 save_info_.file_path.value().c_str()); |
332 } | 332 } |
OLD | NEW |