Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1903)

Unified Diff: net/base/net_util.cc

Issue 9854011: Normalize download file name on chromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/download/save_package_file_picker_chromeos.cc ('k') | net/base/net_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_util.cc
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index 2ba3b4688f1dc3718c58f0d03aa52ba211edebb3..21fb07f0a4b9a53f7da3d2b161cf744f1ea8be0f 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -1505,6 +1505,15 @@ FilePath GenerateFileName(const GURL& url,
#else
FilePath generated_name(base::SysWideToNativeMB(UTF16ToWide(file_name)));
#endif
+
+#if defined(OS_CHROMEOS)
+ // When doing file manager operations on ChromeOS, the file paths get
+ // normalized in WebKit layer, so let's ensure downloaded files have
+ // normalized names. Otherwise, we won't be able to handle files with NFD
+ // utf8 encoded characters in name.
+ file_util::NormalizeFileNameEncoding(&generated_name);
+#endif
+
DCHECK(!generated_name.empty());
return generated_name;
« no previous file with comments | « chrome/browser/download/save_package_file_picker_chromeos.cc ('k') | net/base/net_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698