From a23de85783d944cbb75f09737eb29c60ea87481d Mon Sep 17 00:00:00 2001 From: "mhm@chromium.org" Date: Wed, 3 Jun 2009 02:16:32 +0000 Subject: Local text file with spaces in filename is urlencoded in tab title When viewing a local text file with spaces in filename, it is still urlencoded. Filename should be displayed with spaces, not with urlencoding. It would be more user-friendly. Since net::FormatURL is already implemented, using it would be great. But it doesn't escape SPACES, just NORMAL, it doesn't even escape unicode. I plumbed out a unescapeurl that could be used whether we allow conversion of spaces or not. BUG=8775 (http://crbug.com/8775) TEST=Tested whether the input is escaped in the navigational context and ran the net tests New Review: http://codereview.chromium.org/118059 Review URL: http://codereview.chromium.org/56053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17462 0039d316-1c4b-4281-b951-d872f2087c98 --- app/gfx/text_elider.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/gfx/text_elider.cc b/app/gfx/text_elider.cc index e7b279f..72ee61d 100644 --- a/app/gfx/text_elider.cc +++ b/app/gfx/text_elider.cc @@ -33,7 +33,7 @@ std::wstring ElideUrl(const GURL& url, // Get a formatted string and corresponding parsing of the url. url_parse::Parsed parsed; std::wstring url_string = - net::FormatUrl(url, languages, true, true, &parsed, NULL); + net::FormatUrl(url, languages, true, UnescapeRule::SPACES, &parsed, NULL); if (available_pixel_width <= 0) return url_string; @@ -329,7 +329,7 @@ SortedDisplayURL::SortedDisplayURL(const GURL& url, string16 host_minus_www = WideToUTF16Hack(net::StripWWW(host)); url_parse::Parsed parsed; display_url_ = WideToUTF16Hack(net::FormatUrl(url, languages, - true, true, &parsed, &prefix_end_)); + true, UnescapeRule::SPACES, &parsed, &prefix_end_)); if (sort_host_.length() > host_minus_www.length()) { prefix_end_ += sort_host_.length() - host_minus_www.length(); sort_host_.swap(host_minus_www); -- cgit v1.1