diff options
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)) { |