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

Unified Diff: chrome/browser/download/download_file_picker_chromeos.cc

Issue 9854011: Normalize download file name on chromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test case 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
Index: chrome/browser/download/download_file_picker_chromeos.cc
diff --git a/chrome/browser/download/download_file_picker_chromeos.cc b/chrome/browser/download/download_file_picker_chromeos.cc
index 1ee498ad0cff027b54c8b3b6f342c8f989a887c5..354c64a4fcf9ba4ec98ce8d6d6c9600700757d96 100644
--- a/chrome/browser/download/download_file_picker_chromeos.cc
+++ b/chrome/browser/download/download_file_picker_chromeos.cc
@@ -6,16 +6,18 @@
#include "base/bind.h"
#include "base/file_util.h"
+#include "base/i18n/file_util_icu.h"
#include "base/memory/ref_counted.h"
#include "base/threading/sequenced_worker_pool.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/download_item.h"
-#include "content/public/browser/download_manager.h"
#include "chrome/browser/chromeos/gdata/gdata_download_observer.h"
#include "chrome/browser/chromeos/gdata/gdata_file_system.h"
#include "chrome/browser/chromeos/gdata/gdata_system_service.h"
#include "chrome/browser/chromeos/gdata/gdata_util.h"
+#include "chrome/browser/download/download_util.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/download_item.h"
+#include "content/public/browser/download_manager.h"
using content::BrowserThread;
using content::DownloadManager;
@@ -63,9 +65,13 @@ DownloadFilePickerChromeOS::DownloadFilePickerChromeOS(
DownloadFilePickerChromeOS::~DownloadFilePickerChromeOS() {
}
-void DownloadFilePickerChromeOS::FileSelected(const FilePath& path,
+void DownloadFilePickerChromeOS::FileSelected(const FilePath& selected_path,
int index,
void* params) {
+ FilePath normalized_file_name = selected_path.BaseName();
+ file_util::NormalizeFileNameOnChromeOS(&normalized_file_name);
+ FilePath path = selected_path.DirName().Append(normalized_file_name);
+
RecordFileSelected(path);
if (download_manager_) {

Powered by Google App Engine
This is Rietveld 408576698