OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/download/download_file_manager.h" | 5 #include "chrome/browser/download/download_file_manager.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/task.h" | 8 #include "base/task.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 const std::string& referrer_charset, | 77 const std::string& referrer_charset, |
78 const DownloadSaveInfo& save_info, | 78 const DownloadSaveInfo& save_info, |
79 int render_process_host_id, | 79 int render_process_host_id, |
80 int render_view_id, | 80 int render_view_id, |
81 URLRequestContextGetter* request_context_getter) { | 81 URLRequestContextGetter* request_context_getter) { |
82 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); | 82 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); |
83 | 83 |
84 URLRequestContext* context = request_context_getter->GetURLRequestContext(); | 84 URLRequestContext* context = request_context_getter->GetURLRequestContext(); |
85 context->set_referrer_charset(referrer_charset); | 85 context->set_referrer_charset(referrer_charset); |
86 | 86 |
| 87 // Show "Save As" UI. |
| 88 bool prompt_for_save_location = true; |
87 resource_dispatcher_host_->BeginDownload(url, | 89 resource_dispatcher_host_->BeginDownload(url, |
88 referrer, | 90 referrer, |
89 save_info, | 91 save_info, |
| 92 prompt_for_save_location, |
90 render_process_host_id, | 93 render_process_host_id, |
91 render_view_id, | 94 render_view_id, |
92 context); | 95 context); |
93 } | 96 } |
94 | 97 |
95 // Notifications sent from the download thread and run on the UI thread. | 98 // Notifications sent from the download thread and run on the UI thread. |
96 | 99 |
97 // Lookup the DownloadManager for this TabContents' profile and inform it of | 100 // Lookup the DownloadManager for this TabContents' profile and inform it of |
98 // a new download. | 101 // a new download. |
99 // TODO(paulg): When implementing download restart via the Downloads tab, | 102 // TODO(paulg): When implementing download restart via the Downloads tab, |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 delete download; | 501 delete download; |
499 } | 502 } |
500 | 503 |
501 if (downloads_.empty()) { | 504 if (downloads_.empty()) { |
502 ChromeThread::PostTask( | 505 ChromeThread::PostTask( |
503 ChromeThread::UI, FROM_HERE, | 506 ChromeThread::UI, FROM_HERE, |
504 NewRunnableMethod(this, &DownloadFileManager::StopUpdateTimer)); | 507 NewRunnableMethod(this, &DownloadFileManager::StopUpdateTimer)); |
505 } | 508 } |
506 } | 509 } |
507 | 510 |
OLD | NEW |