diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-09 22:20:40 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-09 22:20:40 +0000 |
commit | 1685f9b0efb3f65bc084e8b012357e2986d073d1 (patch) | |
tree | dafcc9e7d2bf8cddff882638432bd492c983fd77 /chrome/browser/net | |
parent | 6d1b928bc85521046fa7713abadc762beba11881 (diff) | |
download | chromium_src-1685f9b0efb3f65bc084e8b012357e2986d073d1.zip chromium_src-1685f9b0efb3f65bc084e8b012357e2986d073d1.tar.gz chromium_src-1685f9b0efb3f65bc084e8b012357e2986d073d1.tar.bz2 |
Strips http from the omnibox
BUG=none
TEST=type in urls and make sure once loaded we don't show http. Make sure we do show https (and other schemes) though.
Review URL: http://codereview.chromium.org/1513023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44140 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net')
-rw-r--r-- | chrome/browser/net/browser_url_util.cc | 6 | ||||
-rw-r--r-- | chrome/browser/net/url_fixer_upper.cc | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/chrome/browser/net/browser_url_util.cc b/chrome/browser/net/browser_url_util.cc index 9c8ab48..24747b2 100644 --- a/chrome/browser/net/browser_url_util.cc +++ b/chrome/browser/net/browser_url_util.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -23,8 +23,8 @@ void WriteURLToClipboard(const GURL& url, // may not encode non-ASCII characters in UTF-8. See crbug.com/2820. string16 text = url.SchemeIs(chrome::kMailToScheme) ? ASCIIToUTF16(url.path()) : - WideToUTF16(net::FormatUrl(url, languages, false, UnescapeRule::NONE, - NULL, NULL, NULL)); + WideToUTF16(net::FormatUrl(url, languages, net::kFormatUrlOmitNothing, + UnescapeRule::NONE, NULL, NULL, NULL)); ScopedClipboardWriter scw(clipboard); scw.WriteURL(text); diff --git a/chrome/browser/net/url_fixer_upper.cc b/chrome/browser/net/url_fixer_upper.cc index edacefd..9d974db 100644 --- a/chrome/browser/net/url_fixer_upper.cc +++ b/chrome/browser/net/url_fixer_upper.cc @@ -170,8 +170,9 @@ static std::string FixupPath(const std::string& text) { // Here, we know the input looks like a file. GURL file_url = net::FilePathToFileURL(FilePath(filename)); if (file_url.is_valid()) { - return WideToUTF8(net::FormatUrl(file_url, std::wstring(), true, - UnescapeRule::NORMAL, NULL, NULL, NULL)); + return WideToUTF8(net::FormatUrl(file_url, std::wstring(), + net::kFormatUrlOmitUsernamePassword, UnescapeRule::NORMAL, NULL, + NULL, NULL)); } // Invalid file URL, just return the input. @@ -557,7 +558,8 @@ std::string URLFixerUpper::FixupRelativeFile(const FilePath& base_dir, GURL file_url = net::FilePathToFileURL(full_path); if (file_url.is_valid()) return WideToUTF8(net::FormatUrl(file_url, std::wstring(), - true, UnescapeRule::NORMAL, NULL, NULL, NULL)); + net::kFormatUrlOmitUsernamePassword, UnescapeRule::NORMAL, NULL, + NULL, NULL)); // Invalid files fall through to regular processing. } |