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

Unified Diff: chrome/browser/omnibox/omnibox_field_trial.cc

Issue 67553002: Omnibox Field Trial: Make HQP Score Bookmarks More Highly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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/omnibox/omnibox_field_trial.cc
diff --git a/chrome/browser/omnibox/omnibox_field_trial.cc b/chrome/browser/omnibox/omnibox_field_trial.cc
index e2c7144101483c2a6f0528524ec7d2854d086458..8d0943ae9b32ee88f57df418d8fca40f1521f0c2 100644
--- a/chrome/browser/omnibox/omnibox_field_trial.cc
+++ b/chrome/browser/omnibox/omnibox_field_trial.cc
@@ -272,6 +272,20 @@ bool OmniboxFieldTrial::ReorderForLegalDefaultMatch(
kReorderForLegalDefaultMatchRuleEnabled;
}
+int OmniboxFieldTrial::HQPBookmarkValue() {
+ std::string bookmark_value_str = chrome_variations::
+ GetVariationParamValue(kBundledExperimentFieldTrialName,
+ kHQPBookmarkValueRule);
+ if (bookmark_value_str.empty())
+ return 1;
+ // This is a best-effort conversion; we trust the hand-crafted parameters
+ // downloaded from the server to be perfect. There's no need for handle
+ // errors smartly.
+ int bookmark_value;
+ base::StringToInt(bookmark_value_str, &bookmark_value);
+ return bookmark_value;
+}
+
const char OmniboxFieldTrial::kBundledExperimentFieldTrialName[] =
"OmniboxBundledExperimentV1";
const char OmniboxFieldTrial::kShortcutsScoringMaxRelevanceRule[] =
@@ -280,6 +294,8 @@ const char OmniboxFieldTrial::kSearchHistoryRule[] = "SearchHistory";
const char OmniboxFieldTrial::kDemoteByTypeRule[] = "DemoteByType";
const char OmniboxFieldTrial::kReorderForLegalDefaultMatchRule[] =
"ReorderForLegalDefaultMatch";
+const char OmniboxFieldTrial::kHQPBookmarkValueRule[] =
+ "HQPBookmarkValue";
const char OmniboxFieldTrial::kReorderForLegalDefaultMatchRuleEnabled[] =
"ReorderForLegalDefaultMatch";

Powered by Google App Engine
This is Rietveld 408576698