summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpearson@chromium.org <mpearson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-14 00:39:46 +0000
committermpearson@chromium.org <mpearson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-14 00:39:46 +0000
commit0a5c63fcec691789f4d853f76543babe5017c88f (patch)
tree11c09f61a1b04e47415f9fdee72103c2a1632449
parent61582e8c1737f572a99b201bf884daa32faa5082 (diff)
downloadchromium_src-0a5c63fcec691789f4d853f76543babe5017c88f.zip
chromium_src-0a5c63fcec691789f4d853f76543babe5017c88f.tar.gz
chromium_src-0a5c63fcec691789f4d853f76543babe5017c88f.tar.bz2
Omnibox: HistorQuick Provider: Remove Reorder-for-Inlining Ability
It was only used when explicitly enabled on the command line. I don't need it anymore because I'm putting into place a better strategy for reordering for inlining. (Individual providers don't have to do it themselves; the controller will do it for them.) BUG= Review URL: https://chromiumcodereview.appspot.com/18877006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211580 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/about_flags.cc20
-rw-r--r--chrome/browser/autocomplete/history_quick_provider.cc30
-rw-r--r--chrome/browser/autocomplete/history_quick_provider.h18
-rw-r--r--chrome/common/chrome_switches.cc12
-rw-r--r--chrome/common/chrome_switches.h3
5 files changed, 1 insertions, 82 deletions
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 8cabc72..3d6a89b 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -118,19 +118,6 @@ std::set<CommandLine::StringType> ExtractFlagsFromCommandLine(
return flags;
}
-const Experiment::Choice
- kOmniboxHistoryQuickProviderReorderForInliningChoices[] = {
- { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_AUTOMATIC,
- "",
- "" },
- { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_ENABLED,
- switches::kOmniboxHistoryQuickProviderReorderForInlining,
- switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled },
- { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DISABLED,
- switches::kOmniboxHistoryQuickProviderReorderForInlining,
- switches::kOmniboxHistoryQuickProviderReorderForInliningDisabled }
-};
-
const Experiment::Choice kEnableCompositingForFixedPositionChoices[] = {
{ IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
{ IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
@@ -692,13 +679,6 @@ const Experiment kExperiments[] = {
SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
},
{
- "omnibox-history-quick-provider-reorder-for-inlining",
- IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME,
- IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION,
- kOsAll,
- MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderReorderForInliningChoices)
- },
- {
"enable-panels",
IDS_FLAGS_ENABLE_PANELS_NAME,
IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
diff --git a/chrome/browser/autocomplete/history_quick_provider.cc b/chrome/browser/autocomplete/history_quick_provider.cc
index 801c19b..073aa18 100644
--- a/chrome/browser/autocomplete/history_quick_provider.cc
+++ b/chrome/browser/autocomplete/history_quick_provider.cc
@@ -56,12 +56,7 @@ HistoryQuickProvider::HistoryQuickProvider(
Profile* profile)
: HistoryProvider(listener, profile,
AutocompleteProvider::TYPE_HISTORY_QUICK),
- languages_(profile_->GetPrefs()->GetString(prefs::kAcceptLanguages)),
- reorder_for_inlining_(false) {
- reorder_for_inlining_ = CommandLine::ForCurrentProcess()->
- GetSwitchValueASCII(switches::
- kOmniboxHistoryQuickProviderReorderForInlining) ==
- switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled;
+ languages_(profile_->GetPrefs()->GetString(prefs::kAcceptLanguages)) {
}
void HistoryQuickProvider::Start(const AutocompleteInput& input,
@@ -117,29 +112,6 @@ void HistoryQuickProvider::DoAutocomplete() {
if (matches.empty())
return;
- // If we're allowed to reorder results in order to get an inlineable
- // result to appear first (and hence have a HistoryQuickProvider
- // suggestion possibly appear first), find the first inlineable
- // result and then swap it to the front. Obviously, don't do this
- // if we're told to prevent inline autocompletion. (If we're told
- // we're going to prevent inline autocompletion, we're going to
- // 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_ &&
- !PreventInlineAutocomplete(autocomplete_input_)) {
- for (ScoredHistoryMatches::iterator i(matches.begin());
- (i != matches.end()) &&
- (i->raw_score >= AutocompleteResult::kLowestDefaultScore);
- ++i) {
- if (i->can_inline) { // this test is only true once because of the break
- if (i != matches.begin())
- std::rotate(matches.begin(), i, i + 1);
- break;
- }
- }
- }
-
// Figure out if HistoryURL provider has a URL-what-you-typed match
// that ought to go first and what its score will be.
bool will_have_url_what_you_typed_match_first = false;
diff --git a/chrome/browser/autocomplete/history_quick_provider.h b/chrome/browser/autocomplete/history_quick_provider.h
index f60ac08..a4208ba 100644
--- a/chrome/browser/autocomplete/history_quick_provider.h
+++ b/chrome/browser/autocomplete/history_quick_provider.h
@@ -79,24 +79,6 @@ class HistoryQuickProvider : public HistoryProvider {
AutocompleteInput autocomplete_input_;
std::string languages_;
- // True if we're allowed to reorder results depending on
- // inlineability in order to assign higher relevance scores.
- // Consider a case where ScoredHistoryMatch provides results x and
- // y, where x is not inlineable and has a score of 3000 and y is
- // inlineable and has a score of 2500. If reorder_for_inlining_ is
- // false, then x gets demoted to a non-inlineable score (1199) and y
- // gets demoted to a lower score (1198) because we try to preserve
- // the order. On the other hand, if reorder_for_inlining_ is true,
- // then y keeps its score of 2500 and x gets demoted to 2499 in
- // order to follow y. There will not be any problems with an
- // unexpected inline because the non-inlineable result x scores
- // lower than the inlineable one.
- // TODO(mpearson): remove this variable after we're done experimenting.
- // (This member is meant to only exist for experimentation purposes.
- // Once we know which behavior is better, we should rip out this variable
- // and make the best behavior the default.)
- bool reorder_for_inlining_;
-
// Only used for testing.
scoped_ptr<history::InMemoryURLIndex> index_for_testing_;
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 227f273..6c95d72 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -994,18 +994,6 @@ const char kNoStartupWindow[] = "no-startup-window";
// Autoconfig (PAC) script.
const char kNumPacThreads[] = "num-pac-threads";
-// Controls whether HistoryQuickProvider is allowed to reorder results
-// according to inlineability in order to more aggressively assign/keep
-// high relevance scores.
-const char kOmniboxHistoryQuickProviderReorderForInlining[] =
- "omnibox-history-quick-provider-reorder-for-inlining";
-// The value the kOmniboxHistoryQuickProviderReorderForInlining switch may
-// have, as in "--omnibox-history-quick-provider-reorder-for-inlining=1".
-// 1 means allow reordering results.
-const char kOmniboxHistoryQuickProviderReorderForInliningEnabled[] = "1";
-// 0 means don't allow reordering results ( == current behavior as of 6/2012).
-const char kOmniboxHistoryQuickProviderReorderForInliningDisabled[] = "0";
-
// When the option to block third-party cookies is enabled, only block
// third-party cookies from being set.
const char kOnlyBlockSettingThirdPartyCookies[] =
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 6bf829c..f6f682b 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -269,9 +269,6 @@ extern const char kNoServiceAutorun[];
extern const char kNoStartupWindow[];
extern const char kNtpAppInstallHint[];
extern const char kNumPacThreads[];
-extern const char kOmniboxHistoryQuickProviderReorderForInlining[];
-extern const char kOmniboxHistoryQuickProviderReorderForInliningEnabled[];
-extern const char kOmniboxHistoryQuickProviderReorderForInliningDisabled[];
extern const char kOnlyBlockSettingThirdPartyCookies[];
extern const char kOpenInNewWindow[];
extern const char kOrganicInstall[];