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/renderer_host/download_resource_handler.h" | 5 #include "chrome/browser/renderer_host/download_resource_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // resume downloading. | 98 // resume downloading. |
99 | 99 |
100 std::string content_type_header; | 100 std::string content_type_header; |
101 if (!response->response_head.headers || | 101 if (!response->response_head.headers || |
102 !response->response_head.headers->GetMimeType(&content_type_header)) | 102 !response->response_head.headers->GetMimeType(&content_type_header)) |
103 content_type_header = ""; | 103 content_type_header = ""; |
104 info->original_mime_type = content_type_header; | 104 info->original_mime_type = content_type_header; |
105 | 105 |
106 info->prompt_user_for_save_location = | 106 info->prompt_user_for_save_location = |
107 save_as_ && save_info_.file_path.empty(); | 107 save_as_ && save_info_.file_path.empty(); |
108 info->is_dangerous_file = false; | |
109 info->is_dangerous_url = false; | |
110 info->referrer_charset = request_->context()->referrer_charset(); | 108 info->referrer_charset = request_->context()->referrer_charset(); |
111 info->save_info = save_info_; | 109 info->save_info = save_info_; |
112 BrowserThread::PostTask( | 110 BrowserThread::PostTask( |
113 BrowserThread::UI, FROM_HERE, | 111 BrowserThread::UI, FROM_HERE, |
114 NewRunnableMethod( | 112 NewRunnableMethod( |
115 download_file_manager_, &DownloadFileManager::StartDownload, info)); | 113 download_file_manager_, &DownloadFileManager::StartDownload, info)); |
116 | 114 |
117 // We can't start saving the data before we create the file on disk. | 115 // We can't start saving the data before we create the file on disk. |
118 // The request will be un-paused in DownloadFileManager::CreateDownloadFile. | 116 // The request will be un-paused in DownloadFileManager::CreateDownloadFile. |
119 rdh_->PauseRequest(global_id_.child_id, global_id_.request_id, true); | 117 rdh_->PauseRequest(global_id_.child_id, global_id_.request_id, true); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 " render_view_id_ = " "%d" | 254 " render_view_id_ = " "%d" |
257 " save_info_.file_path = \"%" PRFilePath "\"" | 255 " save_info_.file_path = \"%" PRFilePath "\"" |
258 " }", | 256 " }", |
259 request_->url().spec().c_str(), | 257 request_->url().spec().c_str(), |
260 download_id_, | 258 download_id_, |
261 global_id_.child_id, | 259 global_id_.child_id, |
262 global_id_.request_id, | 260 global_id_.request_id, |
263 render_view_id_, | 261 render_view_id_, |
264 save_info_.file_path.value().c_str()); | 262 save_info_.file_path.value().c_str()); |
265 } | 263 } |
OLD | NEW |