| 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> |
| 11 #endif | 11 #endif |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/file_util.h" | 14 #include "base/file_util.h" |
| 15 #include "base/i18n/rtl.h" | 15 #include "base/i18n/rtl.h" |
| 16 #include "base/i18n/time_formatting.h" | 16 #include "base/i18n/time_formatting.h" |
| 17 #include "base/lazy_instance.h" | 17 #include "base/lazy_instance.h" |
| 18 #include "base/metrics/histogram.h" | 18 #include "base/metrics/histogram.h" |
| 19 #include "base/path_service.h" | 19 #include "base/path_service.h" |
| 20 #include "base/string16.h" | 20 #include "base/string16.h" |
| 21 #include "base/string_number_conversions.h" | 21 #include "base/string_number_conversions.h" |
| 22 #include "base/stringprintf.h" | 22 #include "base/stringprintf.h" |
| 23 #include "base/sys_string_conversions.h" | 23 #include "base/sys_string_conversions.h" |
| 24 #include "base/threading/thread_restrictions.h" | 24 #include "base/threading/thread_restrictions.h" |
| 25 #include "base/utf_string_conversions.h" | 25 #include "base/utf_string_conversions.h" |
| 26 #include "base/value_conversions.h" | 26 #include "base/value_conversions.h" |
| 27 #include "base/values.h" | 27 #include "base/values.h" |
| 28 #include "base/win/windows_version.h" | 28 #include "base/win/windows_version.h" |
| 29 #include "chrome/browser/download/download_create_info.h" | |
| 30 #include "chrome/browser/download/download_extensions.h" | 29 #include "chrome/browser/download/download_extensions.h" |
| 31 #include "chrome/browser/download/download_item.h" | |
| 32 #include "chrome/browser/download/download_item_model.h" | 30 #include "chrome/browser/download/download_item_model.h" |
| 33 #include "chrome/browser/download/download_manager.h" | |
| 34 #include "chrome/browser/download/download_types.h" | |
| 35 #include "chrome/browser/profiles/profile.h" | 31 #include "chrome/browser/profiles/profile.h" |
| 36 #include "chrome/browser/ui/browser.h" | 32 #include "chrome/browser/ui/browser.h" |
| 37 #include "chrome/common/chrome_notification_types.h" | 33 #include "chrome/common/chrome_notification_types.h" |
| 38 #include "chrome/common/chrome_paths.h" | 34 #include "chrome/common/chrome_paths.h" |
| 39 #include "chrome/common/time_format.h" | 35 #include "chrome/common/time_format.h" |
| 40 #include "content/browser/browser_thread.h" | 36 #include "content/browser/browser_thread.h" |
| 37 #include "content/browser/download/download_create_info.h" |
| 38 #include "content/browser/download/download_item.h" |
| 39 #include "content/browser/download/download_manager.h" |
| 40 #include "content/browser/download/download_types.h" |
| 41 #include "content/browser/renderer_host/render_view_host.h" | 41 #include "content/browser/renderer_host/render_view_host.h" |
| 42 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 42 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 43 #include "content/browser/tab_contents/tab_contents.h" | 43 #include "content/browser/tab_contents/tab_contents.h" |
| 44 #include "content/common/notification_service.h" | 44 #include "content/common/notification_service.h" |
| 45 #include "grit/generated_resources.h" | 45 #include "grit/generated_resources.h" |
| 46 #include "grit/locale_settings.h" | 46 #include "grit/locale_settings.h" |
| 47 #include "grit/theme_resources.h" | 47 #include "grit/theme_resources.h" |
| 48 #include "net/base/mime_util.h" | 48 #include "net/base/mime_util.h" |
| 49 #include "net/base/net_util.h" | 49 #include "net/base/net_util.h" |
| 50 #include "skia/ext/image_operations.h" | 50 #include "skia/ext/image_operations.h" |
| (...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 FilePath GetCrDownloadPath(const FilePath& suggested_path) { | 812 FilePath GetCrDownloadPath(const FilePath& suggested_path) { |
| 813 FilePath::StringType file_name; | 813 FilePath::StringType file_name; |
| 814 base::SStringPrintf( | 814 base::SStringPrintf( |
| 815 &file_name, | 815 &file_name, |
| 816 PRFilePathLiteral FILE_PATH_LITERAL(".crdownload"), | 816 PRFilePathLiteral FILE_PATH_LITERAL(".crdownload"), |
| 817 suggested_path.value().c_str()); | 817 suggested_path.value().c_str()); |
| 818 return FilePath(file_name); | 818 return FilePath(file_name); |
| 819 } | 819 } |
| 820 | 820 |
| 821 } // namespace download_util | 821 } // namespace download_util |
| OLD | NEW |