summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download_manager.cc
diff options
context:
space:
mode:
authordarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 16:40:10 +0000
committerdarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 16:40:10 +0000
commita9bb6f69b32018c245e05a79011114653fe8f5e0 (patch)
treec4fe6b5db0e508f860c82feb44245bf549d608ff /chrome/browser/download_manager.cc
parentf23423a1245dffc2a368708fafd2867d2cf3e0f8 (diff)
downloadchromium_src-a9bb6f69b32018c245e05a79011114653fe8f5e0.zip
chromium_src-a9bb6f69b32018c245e05a79011114653fe8f5e0.tar.gz
chromium_src-a9bb6f69b32018c245e05a79011114653fe8f5e0.tar.bz2
Move some more classes from net/base into the net:: namespace.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download_manager.cc')
-rw-r--r--chrome/browser/download_manager.cc19
1 files changed, 9 insertions, 10 deletions
diff --git a/chrome/browser/download_manager.cc b/chrome/browser/download_manager.cc
index 06759c9..17851ac 100644
--- a/chrome/browser/download_manager.cc
+++ b/chrome/browser/download_manager.cc
@@ -866,7 +866,7 @@ void DownloadManager::GenerateExtension(const std::wstring& file_name,
extension.assign(default_extension);
std::string mime_type_from_extension;
- mime_util::GetMimeTypeFromFile(file_name, &mime_type_from_extension);
+ net::GetMimeTypeFromFile(file_name, &mime_type_from_extension);
if (mime_type == mime_type_from_extension) {
// The hinted extension matches the mime type. It looks like a winner.
generated_extension->swap(extension);
@@ -877,7 +877,7 @@ void DownloadManager::GenerateExtension(const std::wstring& file_name,
// We want to be careful about executable extensions. The worry here is
// that a trusted web site could be tricked into dropping an executable file
// on the user's filesystem.
- if (!mime_util::GetPreferredExtensionForMimeType(mime_type, &extension)) {
+ if (!net::GetPreferredExtensionForMimeType(mime_type, &extension)) {
// We couldn't find a good extension for this content type. Use a dummy
// extension instead.
extension.assign(default_extension);
@@ -885,7 +885,7 @@ void DownloadManager::GenerateExtension(const std::wstring& file_name,
}
if (extension.empty()) {
- mime_util::GetPreferredExtensionForMimeType(mime_type, &extension);
+ net::GetPreferredExtensionForMimeType(mime_type, &extension);
} else {
// Append entension generated from the mime type if:
// 1. New extension is not ".txt"
@@ -895,8 +895,7 @@ void DownloadManager::GenerateExtension(const std::wstring& file_name,
// E.g. my-cat.jpg becomes my-cat.jpg.js if content type is
// application/x-javascript.
std::wstring append_extension;
- if (mime_util::GetPreferredExtensionForMimeType(mime_type,
- &append_extension)) {
+ if (net::GetPreferredExtensionForMimeType(mime_type, &append_extension)) {
if (append_extension != L".txt" && append_extension != extension &&
!IsExecutable(append_extension))
extension += append_extension;
@@ -973,19 +972,19 @@ bool DownloadManager::ShouldOpenFileExtension(const std::wstring& extension) {
// static
bool DownloadManager::IsExecutableMimeType(const std::string& mime_type) {
// JavaScript is just as powerful as EXE.
- if (mime_util::MatchesMimeType("text/javascript", mime_type))
+ if (net::MatchesMimeType("text/javascript", mime_type))
return true;
- if (mime_util::MatchesMimeType("text/javascript;version=*", mime_type))
+ if (net::MatchesMimeType("text/javascript;version=*", mime_type))
return true;
// We don't consider other non-application types to be executable.
- if (!mime_util::MatchesMimeType("application/*", mime_type))
+ if (!net::MatchesMimeType("application/*", mime_type))
return false;
// These application types are not executable.
- if (mime_util::MatchesMimeType("application/*+xml", mime_type))
+ if (net::MatchesMimeType("application/*+xml", mime_type))
return false;
- if (mime_util::MatchesMimeType("application/xml", mime_type))
+ if (net::MatchesMimeType("application/xml", mime_type))
return false;
return true;