| 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 // Download utility implementation | 5 // Download utility implementation |
| 6 | 6 |
| 7 #include "chrome/browser/download/download_util.h" | 7 #include "chrome/browser/download/download_util.h" |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <shobjidl.h> | 10 #include <shobjidl.h> |
| (...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 ResourceDispatcherHost* rdh, | 883 ResourceDispatcherHost* rdh, |
| 884 int render_process_host_id, | 884 int render_process_host_id, |
| 885 int render_view_id, | 885 int render_view_id, |
| 886 const content::ResourceContext* context) { | 886 const content::ResourceContext* context) { |
| 887 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 887 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 888 | 888 |
| 889 rdh->BeginDownload(url, | 889 rdh->BeginDownload(url, |
| 890 referrer, | 890 referrer, |
| 891 save_info, | 891 save_info, |
| 892 true, // Show "Save as" UI. | 892 true, // Show "Save as" UI. |
| 893 "GET"/*method*/, |
| 894 NULL/*extra_headers*/, |
| 895 ""/*post_body*/, |
| 896 DownloadResourceHandler::OnResponseStartedCallback(), |
| 897 DownloadResourceHandler::OnUnstartableCallback(), |
| 893 render_process_host_id, | 898 render_process_host_id, |
| 894 render_view_id, | 899 render_view_id, |
| 895 *context); | 900 *context); |
| 896 } | 901 } |
| 897 | 902 |
| 898 void NotifyDownloadInitiated(int render_process_id, int render_view_id) { | 903 void NotifyDownloadInitiated(int render_process_id, int render_view_id) { |
| 899 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 904 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 900 RenderViewHost* rvh = RenderViewHost::FromID(render_process_id, | 905 RenderViewHost* rvh = RenderViewHost::FromID(render_process_id, |
| 901 render_view_id); | 906 render_view_id); |
| 902 if (!rvh) | 907 if (!rvh) |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 FilePath GetCrDownloadPath(const FilePath& suggested_path) { | 954 FilePath GetCrDownloadPath(const FilePath& suggested_path) { |
| 950 FilePath::StringType file_name; | 955 FilePath::StringType file_name; |
| 951 base::SStringPrintf( | 956 base::SStringPrintf( |
| 952 &file_name, | 957 &file_name, |
| 953 PRFilePathLiteral FILE_PATH_LITERAL(".crdownload"), | 958 PRFilePathLiteral FILE_PATH_LITERAL(".crdownload"), |
| 954 suggested_path.value().c_str()); | 959 suggested_path.value().c_str()); |
| 955 return FilePath(file_name); | 960 return FilePath(file_name); |
| 956 } | 961 } |
| 957 | 962 |
| 958 } // namespace download_util | 963 } // namespace download_util |
| OLD | NEW |