| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/chrome_thread.h" | 8 #include "chrome/browser/chrome_thread.h" |
| 9 #include "chrome/browser/download/download_item.h" | 9 #include "chrome/browser/download/download_item.h" |
| 10 #include "chrome/browser/download/download_file_manager.h" | 10 #include "chrome/browser/download/download_file_manager.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 !response->response_head.headers->GetMimeType(&content_type_header)) | 85 !response->response_head.headers->GetMimeType(&content_type_header)) |
| 86 content_type_header = ""; | 86 content_type_header = ""; |
| 87 info->original_mime_type = content_type_header; | 87 info->original_mime_type = content_type_header; |
| 88 | 88 |
| 89 info->prompt_user_for_save_location = | 89 info->prompt_user_for_save_location = |
| 90 save_as_ && save_info_.file_path.empty(); | 90 save_as_ && save_info_.file_path.empty(); |
| 91 info->is_dangerous = false; | 91 info->is_dangerous = false; |
| 92 info->referrer_charset = request_->context()->referrer_charset(); | 92 info->referrer_charset = request_->context()->referrer_charset(); |
| 93 info->save_info = save_info_; | 93 info->save_info = save_info_; |
| 94 ChromeThread::PostTask( | 94 ChromeThread::PostTask( |
| 95 ChromeThread::UI, FROM_HERE, | 95 ChromeThread::FILE, FROM_HERE, |
| 96 NewRunnableMethod( | 96 NewRunnableMethod( |
| 97 download_file_manager_, &DownloadFileManager::StartDownload, info)); | 97 download_file_manager_, &DownloadFileManager::StartDownload, info)); |
| 98 return true; | 98 return true; |
| 99 } | 99 } |
| 100 | 100 |
| 101 bool DownloadResourceHandler::OnWillStart(int request_id, | 101 bool DownloadResourceHandler::OnWillStart(int request_id, |
| 102 const GURL& url, | 102 const GURL& url, |
| 103 bool* defer) { | 103 bool* defer) { |
| 104 return true; | 104 return true; |
| 105 } | 105 } |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 } | 206 } |
| 207 | 207 |
| 208 DownloadResourceHandler::~DownloadResourceHandler() { | 208 DownloadResourceHandler::~DownloadResourceHandler() { |
| 209 } | 209 } |
| 210 | 210 |
| 211 void DownloadResourceHandler::StartPauseTimer() { | 211 void DownloadResourceHandler::StartPauseTimer() { |
| 212 if (!pause_timer_.IsRunning()) | 212 if (!pause_timer_.IsRunning()) |
| 213 pause_timer_.Start(base::TimeDelta::FromMilliseconds(kThrottleTimeMs), this, | 213 pause_timer_.Start(base::TimeDelta::FromMilliseconds(kThrottleTimeMs), this, |
| 214 &DownloadResourceHandler::CheckWriteProgress); | 214 &DownloadResourceHandler::CheckWriteProgress); |
| 215 } | 215 } |
| OLD | NEW |