summaryrefslogtreecommitdiffstats
path: root/net/base/net_util.cc
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-18 20:49:39 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-18 20:49:39 +0000
commitc9b6eb6902766de9edf75921151d225572079a53 (patch)
treeccc35901d698f4c45ec080ec68f8ecef948f0769 /net/base/net_util.cc
parentf92cf517a42dd20517370d5cb0a9b61574477f29 (diff)
downloadchromium_src-c9b6eb6902766de9edf75921151d225572079a53.zip
chromium_src-c9b6eb6902766de9edf75921151d225572079a53.tar.gz
chromium_src-c9b6eb6902766de9edf75921151d225572079a53.tar.bz2
content: Make tab_contents_drag_source not depend on download_util.h
This adds a method to the ContentBrowserClient to get what is otherwise localized resources. Most of this patch changes the interface to net::GenerateFileName() to take a utf8 string instead of a utf16 one (which was immediately changed to a utf8 one in implementation.) BUG=none TEST=none Review URL: http://codereview.chromium.org/8113012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106124 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/net_util.cc')
-rw-r--r--net/base/net_util.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index 7ebf0c4..f34f980 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -1457,7 +1457,7 @@ string16 GetSuggestedFilename(const GURL& url,
const std::string& referrer_charset,
const std::string& suggested_name,
const std::string& mime_type,
- const string16& default_name) {
+ const std::string& default_name) {
// TODO: this function to be updated to match the httpbis recommendations.
// Talk to abarth for the latest news.
@@ -1507,7 +1507,7 @@ string16 GetSuggestedFilename(const GURL& url,
}
#if defined(OS_WIN)
- string16 path = (filename.empty())? default_name : UTF8ToUTF16(filename);
+ string16 path = UTF8ToUTF16(filename.empty() ? default_name : filename);
// On Windows we want to preserve or replace all characters including
// whitespace to prevent file extension obfuscation on trusted websites
// e.g. Gmail might think evil.exe. is safe, so we don't want it to become
@@ -1521,7 +1521,7 @@ string16 GetSuggestedFilename(const GURL& url,
GenerateSafeFileName(mime_type, overwrite_extension, &result);
return result.value();
#else
- std::string path = (filename.empty())? UTF16ToUTF8(default_name) : filename;
+ std::string path = filename.empty() ? default_name : filename;
file_util::ReplaceIllegalCharactersInPath(&path, '-');
FilePath result(path);
GenerateSafeFileName(mime_type, overwrite_extension, &result);
@@ -1534,7 +1534,7 @@ FilePath GenerateFileName(const GURL& url,
const std::string& referrer_charset,
const std::string& suggested_name,
const std::string& mime_type,
- const string16& default_file_name) {
+ const std::string& default_file_name) {
string16 file_name = GetSuggestedFilename(url,
content_disposition,
referrer_charset,