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

Unified Diff: chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc

Issue 7778008: Truncate file name longer than MAX_PATH(260) on D2D (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Decode Percent-Encoding in file name Created 9 years, 4 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/ui/views/tab_contents/tab_contents_drag_win.cc
diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc b/chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc
index c2e42c027b1dde32c3f5c8d71eb231faf9493a4c..856a6ef207896500d4c29a64b0be4364ebe3e8ac 100644
--- a/chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc
+++ b/chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc
@@ -227,7 +227,11 @@ void TabContentsDragWin::PrepareDragForFileContents(
// synthesize one from the provided extension and URL.
FilePath file_name(drop_data.file_description_filename);
file_name = file_name.BaseName().RemoveExtension();
- if (file_name.value().empty()) {
+
+ // If file_name contains percent-encoded characters, we want to decoded
+ // them to provide friendly file name for international users.
+ if (file_name.value().empty() ||
+ file_name.value().find('%') != std::string::npos) {
sky 2011/09/06 15:55:05 If the file name contains a '%' and you enter this
// Retrieve the name from the URL.
file_name = FilePath(
net::GetSuggestedFilename(drop_data.url, "", "", "", "", string16()));
« no previous file with comments | « no previous file | ui/base/dragdrop/os_exchange_data_provider_win.cc » ('j') | ui/base/dragdrop/os_exchange_data_provider_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698