Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3401)

Unified Diff: chrome/browser/autocomplete/base_search_provider.cc

Issue 372843005: Remove Profile from BaseSearchProvider::NavigationResult (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/autocomplete/base_search_provider.cc
diff --git a/chrome/browser/autocomplete/base_search_provider.cc b/chrome/browser/autocomplete/base_search_provider.cc
index edc88373edeacef19c497232711ce78f815e24af..831f80ca00846c693a6b8d9369470fd052f4ddc9 100644
--- a/chrome/browser/autocomplete/base_search_provider.cc
+++ b/chrome/browser/autocomplete/base_search_provider.cc
@@ -65,15 +65,6 @@ AutocompleteMatchType::Type GetAutocompleteMatchType(const std::string& type) {
return AutocompleteMatchType::SEARCH_SUGGEST;
}
-base::string16 StringForURLDisplayWithAcceptLanguages(Profile* profile,
- const GURL& url) {
- std::string languages = profile ?
- profile->GetPrefs()->GetString(prefs::kAcceptLanguages) : std::string();
- return net::FormatUrl(url, languages,
- net::kFormatUrlOmitAll & ~net::kFormatUrlOmitHTTP,
- net::UnescapeRule::SPACES, NULL, NULL, NULL);
-}
-
} // namespace
// SuggestionDeletionHandler -------------------------------------------------
@@ -364,8 +355,7 @@ int BaseSearchProvider::SuggestResult::CalculateRelevance(
// BaseSearchProvider::NavigationResult ----------------------------------------
BaseSearchProvider::NavigationResult::NavigationResult(
- const AutocompleteProvider& provider,
- Profile* profile,
+ const AutocompleteSchemeClassifier& scheme_classifier,
const GURL& url,
AutocompleteMatchType::Type type,
const base::string16& description,
@@ -379,8 +369,10 @@ BaseSearchProvider::NavigationResult::NavigationResult(
deletion_url),
url_(url),
formatted_url_(AutocompleteInput::FormattedStringWithEquivalentMeaning(
- url, StringForURLDisplayWithAcceptLanguages(profile, url),
- ChromeAutocompleteSchemeClassifier(profile))),
+ url, net::FormatUrl(url, languages,
+ net::kFormatUrlOmitAll & ~net::kFormatUrlOmitHTTP,
+ net::UnescapeRule::SPACES, NULL, NULL, NULL),
+ scheme_classifier)),
description_(description) {
DCHECK(url_.is_valid());
CalculateAndClassifyMatchContents(true, input_text, languages);
@@ -913,9 +905,9 @@ bool BaseSearchProvider::ParseSuggestResults(const base::Value& root_val,
if (descriptions != NULL)
descriptions->GetString(index, &title);
results->navigation_results.push_back(NavigationResult(
- *this, profile_, url, match_type, title, deletion_url,
- is_keyword_result, relevance, relevances != NULL, input.text(),
- languages));
+ ChromeAutocompleteSchemeClassifier(profile_), url, match_type,
+ title, deletion_url, is_keyword_result, relevance,
+ relevances != NULL, input.text(), languages));
}
} else {
base::string16 match_contents = suggestion;
« no previous file with comments | « chrome/browser/autocomplete/base_search_provider.h ('k') | chrome/browser/autocomplete/search_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698