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

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

Issue 18878007: Omnibox: Make the Controller Reorder Matches for Inlining (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/history_quick_provider.cc
diff --git a/chrome/browser/autocomplete/history_quick_provider.cc b/chrome/browser/autocomplete/history_quick_provider.cc
index 1a5eb671c547a8bb27db4d16a318acc66e1dd4f1..79b1c81f6b37b88ed5af9cbb66ffeb2ba4574c9d 100644
--- a/chrome/browser/autocomplete/history_quick_provider.cc
+++ b/chrome/browser/autocomplete/history_quick_provider.cc
@@ -57,7 +57,9 @@ HistoryQuickProvider::HistoryQuickProvider(
: HistoryProvider(listener, profile,
AutocompleteProvider::TYPE_HISTORY_QUICK),
languages_(profile_->GetPrefs()->GetString(prefs::kAcceptLanguages)),
- reorder_for_inlining_(false) {
+ local_reorder_for_inlining_(false),
+ omnibox_will_reorder_for_inlining_(
+ OmniboxFieldTrial::InReorderForInliningGroup()) {
enum InliningOption {
INLINING_PROHIBITED = 0,
INLINING_ALLOWED = 1,
@@ -114,7 +116,7 @@ HistoryQuickProvider::HistoryQuickProvider(
"Omnibox.InlineHistoryQuickProviderFieldTrialBeacon",
inlining_option, NUM_OPTIONS);
- reorder_for_inlining_ = CommandLine::ForCurrentProcess()->
+ local_reorder_for_inlining_ = CommandLine::ForCurrentProcess()->
GetSwitchValueASCII(switches::
kOmniboxHistoryQuickProviderReorderForInlining) ==
switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled;
@@ -182,7 +184,7 @@ void HistoryQuickProvider::DoAutocomplete() {
// later demote the score of all results so none will be inlined.
// Hence there's no need to reorder the results so an inlineable one
// appears first.)
- if (reorder_for_inlining_ &&
+ if (local_reorder_for_inlining_ &&
!PreventInlineAutocomplete(autocomplete_input_)) {
for (ScoredHistoryMatches::iterator i(matches.begin());
(i != matches.end()) &&
@@ -305,7 +307,7 @@ void HistoryQuickProvider::DoAutocomplete() {
TemplateURL* template_url = template_url_service ?
template_url_service->GetDefaultSearchProvider() : NULL;
int max_match_score = (PreventInlineAutocomplete(autocomplete_input_) ||
- !matches.begin()->can_inline) ?
+ (!matches.begin()->can_inline && !omnibox_will_reorder_for_inlining_)) ?
(AutocompleteResult::kLowestDefaultScore - 1) :
matches.begin()->raw_score;
if (will_have_url_what_you_typed_match_first) {

Powered by Google App Engine
This is Rietveld 408576698