diff options
author | mhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-03 02:16:32 +0000 |
---|---|---|
committer | mhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-03 02:16:32 +0000 |
commit | a23de85783d944cbb75f09737eb29c60ea87481d (patch) | |
tree | 30c4732b42443259134a3f83f574bfaa2a506292 /net/base/escape.h | |
parent | 1b5237ecc1fea39e51e1634acbcdf11bd7ef57b0 (diff) | |
download | chromium_src-a23de85783d944cbb75f09737eb29c60ea87481d.zip chromium_src-a23de85783d944cbb75f09737eb29c60ea87481d.tar.gz chromium_src-a23de85783d944cbb75f09737eb29c60ea87481d.tar.bz2 |
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
Diffstat (limited to 'net/base/escape.h')
-rw-r--r-- | net/base/escape.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/net/base/escape.h b/net/base/escape.h index 1502b56..17f8646 100644 --- a/net/base/escape.h +++ b/net/base/escape.h @@ -41,32 +41,36 @@ class UnescapeRule { typedef uint32 Type; enum { + // Don't unescape anything at all. + NONE = 0, + // Don't unescape anything special, but all normal unescaping will happen. // This is a placeholder and can't be combined with other flags (since it's - // just the absense of them). Things like escaped letters, digits, and most - // symbols will get unescaped with this mode. - NORMAL = 0, + // just the absence of them). All other unescape rules imply "normal" in + // addition to their special meaning. Things like escaped letters, digits, + // and most symbols will get unescaped with this mode. + NORMAL = 1, // Convert %20 to spaces. In some places where we're showing URLs, we may // want this. In places where the URL may be copied and pasted out, then // you wouldn't want this since it might not be interpreted in one piece // by other applications. - SPACES = 1, + SPACES = 2, // Unescapes various characters that will change the meaning of URLs, - // including '%', '+', '&', '/', '#'. If we unescaped these charaters, the + // including '%', '+', '&', '/', '#'. If we unescaped these characters, the // resulting URL won't be the same as the source one. This flag is used when // generating final output like filenames for URLs where we won't be // interpreting as a URL and want to do as much unescaping as possible. - URL_SPECIAL_CHARS = 2, + URL_SPECIAL_CHARS = 4, - // Unescapes control characters such as %01. This INCLUDES NULLs!. This is + // Unescapes control characters such as %01. This INCLUDES NULLs. This is // used for rare cases such as data: URL decoding where the result is binary // data. You should not use this for normal URLs! - CONTROL_CHARS = 4, + CONTROL_CHARS = 8, // URL queries use "+" for space. This flag controls that replacement. - REPLACE_PLUS_WITH_SPACE = 8, + REPLACE_PLUS_WITH_SPACE = 16, }; }; |