diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-02 02:37:40 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-02 02:37:40 +0000 |
commit | 79845effcd569cb61784e8a8c221f839e6e23525 (patch) | |
tree | d86e942097765499876b48a5d764592e2b9c376f /chrome/browser/toolbar_model.cc | |
parent | 9902c201466fe4a701f43a124f4d22b6829c87e6 (diff) | |
download | chromium_src-79845effcd569cb61784e8a8c221f839e6e23525.zip chromium_src-79845effcd569cb61784e8a8c221f839e6e23525.tar.gz chromium_src-79845effcd569cb61784e8a8c221f839e6e23525.tar.bz2 |
Strip the trailing slash from URLs like "http://google.com/". This especially helps when the scheme has also been stripped, as it makes the hostname look less unbalanced. We're careful to avoid stripping the slash when doing so would confuse the omnibox.
This also moves to more aggressive stripping and/or unescaping in several places. In general, it seems like we should be as aggressive as is feasible.
BUG=43587
TEST=Visit google.com. There should be no slash in the address bar.
Review URL: http://codereview.chromium.org/2389002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48691 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/toolbar_model.cc')
-rw-r--r-- | chrome/browser/toolbar_model.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/chrome/browser/toolbar_model.cc b/chrome/browser/toolbar_model.cc index a591e5c..740bc3e9 100644 --- a/chrome/browser/toolbar_model.cc +++ b/chrome/browser/toolbar_model.cc @@ -53,8 +53,12 @@ std::wstring ToolbarModel::GetText() const { url = GURL(url.scheme() + ":"); } } - return net::FormatUrl(url, languages, net::kFormatUrlOmitAll, - UnescapeRule::NORMAL, NULL, NULL, NULL); + // Note that we can't unescape spaces here, because if the user copies this + // and pastes it into another program, that program may think the URL ends at + // the space. + return AutocompleteInput::FormattedStringWithEquivalentMeaning(url, + net::FormatUrl(url, languages, net::kFormatUrlOmitAll, + UnescapeRule::NORMAL, NULL, NULL, NULL)); } ToolbarModel::SecurityLevel ToolbarModel::GetSecurityLevel() const { |