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

Unified Diff: components/omnibox/autocomplete_result.cc

Issue 1098843004: Omnibox - Do Not Allow HTTP/HTTPS Equivalence if User Explicitly Entered A Scheme (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: possible fix for mac code (cannot compile mac code myself) Created 5 years, 6 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: components/omnibox/autocomplete_result.cc
diff --git a/components/omnibox/autocomplete_result.cc b/components/omnibox/autocomplete_result.cc
index a7299462e9806933f4b742e5c32115f2105829af..22e385dc7cf070b3f20022651fa033a5f8ea3e02 100644
--- a/components/omnibox/autocomplete_result.cc
+++ b/components/omnibox/autocomplete_result.cc
@@ -14,6 +14,7 @@
#include "components/omnibox/autocomplete_input.h"
#include "components/omnibox/autocomplete_match.h"
#include "components/omnibox/autocomplete_provider.h"
+#include "components/omnibox/autocomplete_provider_client.h"
#include "components/omnibox/omnibox_field_trial.h"
#include "components/search/search.h"
#include "components/url_fixer/url_fixer.h"
@@ -107,7 +108,8 @@ void AutocompleteResult::Selection::Clear() {
is_history_what_you_typed_match = false;
}
-AutocompleteResult::AutocompleteResult() {
+AutocompleteResult::AutocompleteResult(AutocompleteProviderClient* client):
+ client_(client) {
// Reserve space for the max number of matches we'll show.
matches_.reserve(kMaxMatches);
@@ -179,8 +181,10 @@ void AutocompleteResult::AppendMatches(const AutocompleteInput& input,
void AutocompleteResult::SortAndCull(
const AutocompleteInput& input,
TemplateURLService* template_url_service) {
- for (ACMatches::iterator i(matches_.begin()); i != matches_.end(); ++i)
- i->ComputeStrippedDestinationURL(template_url_service);
+ for (ACMatches::iterator i(matches_.begin()); i != matches_.end(); ++i) {
+ i->ComputeStrippedDestinationURL(
+ input, client_->GetAcceptLanguages(), template_url_service);
+ }
DedupMatchesByDestination(input.current_page_classification(), true,
&matches_);

Powered by Google App Engine
This is Rietveld 408576698