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

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

Issue 6246036: FilePath: Remove most of ToWStringHack, adding a LossyDisplayName() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: bug link Created 9 years, 11 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/download_browsertest.cc ('k') | chrome/browser/download/download_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_item.cc
diff --git a/chrome/browser/download/download_item.cc b/chrome/browser/download/download_item.cc
index 620828b90c536bf57467ead14a67b7c248132926..beb9cf77fa605d6d98f055bab7268a53beace420 100644
--- a/chrome/browser/download/download_item.cc
+++ b/chrome/browser/download/download_item.cc
@@ -486,8 +486,12 @@ bool DownloadItem::MatchesQuery(const string16& query) const {
if (url_formatted.find(query) != string16::npos)
return true;
- string16 path(l10n_util::ToLower(WideToUTF16(full_path().ToWStringHack())));
- if (path.find(query) != std::wstring::npos)
+ string16 path(l10n_util::ToLower(full_path().LossyDisplayName()));
+ // This shouldn't just do a substring match; it is wrong for Unicode
+ // due to normalization and we have a fancier search-query system
+ // used elsewhere.
+ // http://code.google.com/p/chromium/issues/detail?id=71982
+ if (path.find(query) != string16::npos)
return true;
return false;
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/download/download_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698