diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 06:14:17 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 06:14:17 +0000 |
commit | 9f284f13fd93a37bd8afa4840e91a953f4c9bc51 (patch) | |
tree | 4a5e7e73c5ed978b2e18569080a70c18a821da76 /chrome/browser/autocomplete | |
parent | f33fdc5d17ae9e0439d2e68344da6d5f12dc26a5 (diff) | |
download | chromium_src-9f284f13fd93a37bd8afa4840e91a953f4c9bc51.zip chromium_src-9f284f13fd93a37bd8afa4840e91a953f4c9bc51.tar.gz chromium_src-9f284f13fd93a37bd8afa4840e91a953f4c9bc51.tar.bz2 |
Remove the wstring FormatUrl() functions (and convert remaining users to the string16 verison).
Still to do: Actually convert the code underlying FormatUrl().
BUG=23581
TEST=builds and passes tests
Review URL: http://codereview.chromium.org/3263005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57968 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete.cc | 9 | ||||
-rw-r--r-- | chrome/browser/autocomplete/history_url_provider.cc | 13 |
2 files changed, 11 insertions, 11 deletions
diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc index a66c84a..e69d413 100644 --- a/chrome/browser/autocomplete/autocomplete.cc +++ b/chrome/browser/autocomplete/autocomplete.cc @@ -648,14 +648,13 @@ void AutocompleteProvider::UpdateStarredStateOfMatches() { std::wstring AutocompleteProvider::StringForURLDisplay(const GURL& url, bool check_accept_lang, bool trim_http) const { - std::wstring languages = (check_accept_lang && profile_) ? - UTF8ToWide(profile_->GetPrefs()->GetString(prefs::kAcceptLanguages)) : - std::wstring(); - return net::FormatUrl( + std::string languages = (check_accept_lang && profile_) ? + profile_->GetPrefs()->GetString(prefs::kAcceptLanguages) : std::string(); + return UTF16ToWideHack(net::FormatUrl( url, languages, net::kFormatUrlOmitAll & ~(trim_http ? 0 : net::kFormatUrlOmitHTTP), - UnescapeRule::SPACES, NULL, NULL, NULL); + UnescapeRule::SPACES, NULL, NULL, NULL)); } // AutocompleteResult --------------------------------------------------------- diff --git a/chrome/browser/autocomplete/history_url_provider.cc b/chrome/browser/autocomplete/history_url_provider.cc index c2a2bca..20718f7 100644 --- a/chrome/browser/autocomplete/history_url_provider.cc +++ b/chrome/browser/autocomplete/history_url_provider.cc @@ -876,23 +876,24 @@ AutocompleteMatch HistoryURLProvider::HistoryMatchToACMatch( DCHECK(match.destination_url.is_valid()); size_t inline_autocomplete_offset = history_match.input_location + params->input.text().length(); + std::string languages = (match_type == WHAT_YOU_TYPED) ? + std::string() : WideToUTF8(params->languages); const net::FormatUrlTypes format_types = net::kFormatUrlOmitAll & ~((params->trim_http && !history_match.match_in_scheme) ? 0 : net::kFormatUrlOmitHTTP); match.fill_into_edit = AutocompleteInput::FormattedStringWithEquivalentMeaning(info.url(), - net::FormatUrl(info.url(), match_type == WHAT_YOU_TYPED ? - std::wstring() : params->languages, format_types, UnescapeRule::SPACES, - NULL, NULL, &inline_autocomplete_offset)); + UTF16ToWideHack(net::FormatUrl(info.url(), languages, format_types, + UnescapeRule::SPACES, NULL, NULL, + &inline_autocomplete_offset))); if (!params->input.prevent_inline_autocomplete()) match.inline_autocomplete_offset = inline_autocomplete_offset; DCHECK((match.inline_autocomplete_offset == std::wstring::npos) || (match.inline_autocomplete_offset <= match.fill_into_edit.length())); size_t match_start = history_match.input_location; - match.contents = net::FormatUrl(info.url(), - match_type == WHAT_YOU_TYPED ? std::wstring() : params->languages, - format_types, UnescapeRule::SPACES, NULL, NULL, &match_start); + match.contents = UTF16ToWideHack(net::FormatUrl(info.url(), languages, + format_types, UnescapeRule::SPACES, NULL, NULL, &match_start)); if ((match_start != std::wstring::npos) && (inline_autocomplete_offset != std::wstring::npos) && (inline_autocomplete_offset != match_start)) { |