| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 return (download_path == desktop_dir); | 151 return (download_path == desktop_dir); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void GenerateFileNameFromRequest(const DownloadItem& download_item, | 154 void GenerateFileNameFromRequest(const DownloadItem& download_item, |
| 155 FilePath* generated_name) { | 155 FilePath* generated_name) { |
| 156 std::string default_file_name( | 156 std::string default_file_name( |
| 157 l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME)); | 157 l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME)); |
| 158 | 158 |
| 159 *generated_name = net::GenerateFileName(download_item.GetURL(), | 159 *generated_name = net::GenerateFileName(download_item.GetURL(), |
| 160 download_item.GetContentDisposition(), | 160 download_item.GetContentDisposition(), |
| 161 download_item.GetReferrerCharset(), | 161 download_item.GetDefaultCharset(), |
| 162 download_item.GetSuggestedFilename(), | 162 download_item.GetSuggestedFilename(), |
| 163 download_item.GetMimeType(), | 163 download_item.GetMimeType(), |
| 164 default_file_name); | 164 default_file_name); |
| 165 } | 165 } |
| 166 | 166 |
| 167 // Download progress painting -------------------------------------------------- | 167 // Download progress painting -------------------------------------------------- |
| 168 | 168 |
| 169 // Common bitmaps used for download progress animations. We load them once the | 169 // Common bitmaps used for download progress animations. We load them once the |
| 170 // first time we do a progress paint, then reuse them as they are always the | 170 // first time we do a progress paint, then reuse them as they are always the |
| 171 // same. | 171 // same. |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 kMaxShelfSize); | 629 kMaxShelfSize); |
| 630 } | 630 } |
| 631 } | 631 } |
| 632 | 632 |
| 633 void RecordDownloadCount(ChromeDownloadCountTypes type) { | 633 void RecordDownloadCount(ChromeDownloadCountTypes type) { |
| 634 UMA_HISTOGRAM_ENUMERATION( | 634 UMA_HISTOGRAM_ENUMERATION( |
| 635 "Download.CountsChrome", type, DOWNLOAD_COUNT_TYPES_LAST_ENTRY); | 635 "Download.CountsChrome", type, DOWNLOAD_COUNT_TYPES_LAST_ENTRY); |
| 636 } | 636 } |
| 637 | 637 |
| 638 } // namespace download_util | 638 } // namespace download_util |
| OLD | NEW |