Chromium Code Reviews| Index: components/omnibox/omnibox_field_trial.cc |
| diff --git a/components/omnibox/omnibox_field_trial.cc b/components/omnibox/omnibox_field_trial.cc |
| index 96adb803263731c2b3bc50e7b913c7a362dee699..3f2cc07f5b0c4b66df2d4b92f7910ab17b7cfe2d 100644 |
| --- a/components/omnibox/omnibox_field_trial.cc |
| +++ b/components/omnibox/omnibox_field_trial.cc |
| @@ -336,6 +336,29 @@ bool OmniboxFieldTrial::DisplayHintTextWhenPossible() { |
| kDisplayHintTextWhenPossibleRule) == "true"; |
| } |
| +bool OmniboxFieldTrial::DisableResultsCaching() { |
| + return variations::GetVariationParamValue( |
| + kBundledExperimentFieldTrialName, |
| + kDisableResultsCachingRule) == "true"; |
| +} |
| + |
| +void OmniboxFieldTrial::GetSuggestPollingStrategy(bool* since_the_last_request, |
| + int* polling_delay_ms) { |
| + *since_the_last_request = variations::GetVariationParamValue( |
| + kBundledExperimentFieldTrialName, |
| + kSuggestPollingDelaySinceTheLastRequestRule) == "true"; |
|
H Fung
2014/10/20 21:59:42
I'm not sure if you want to have a flag to take in
Bart N.
2014/10/22 01:19:08
I think I'd prefer to stay with the current rule,
|
| + |
| + const std::string& polling_delay_string = variations::GetVariationParamValue( |
| + kBundledExperimentFieldTrialName, |
| + kSuggestPollingDelayMsRule); |
| + if (polling_delay_string.empty() || |
| + !base::StringToInt(polling_delay_string, polling_delay_ms) || |
| + *polling_delay_ms <= 0) { |
|
Mark P
2014/10/21 21:28:22
nit: parans around binary operator <=
Bart N.
2014/10/22 01:19:07
Done.
|
| + // Status Quo (100ms since the last suggest request). |
|
Mark P
2014/10/21 21:28:22
This comment is helpful for reviewers. For the co
Bart N.
2014/10/22 01:19:08
Done.
|
| + *polling_delay_ms = 100; |
| + } |
| +} |
| + |
| const char OmniboxFieldTrial::kBundledExperimentFieldTrialName[] = |
| "OmniboxBundledExperimentV1"; |
| const char OmniboxFieldTrial::kShortcutsScoringMaxRelevanceRule[] = |
| @@ -355,6 +378,12 @@ const char OmniboxFieldTrial::kAddUWYTMatchEvenIfPromotedURLsRule[] = |
| "AddUWYTMatchEvenIfPromotedURLs"; |
| const char OmniboxFieldTrial::kDisplayHintTextWhenPossibleRule[] = |
| "DisplayHintTextWhenPossible"; |
| +const char OmniboxFieldTrial::kDisableResultsCachingRule[] = |
| + "DisableResultsCaching"; |
| +const char OmniboxFieldTrial::kSuggestPollingDelaySinceTheLastRequestRule[] = |
| + "SuggestPollingDelaySinceTheLastRequest"; |
|
Mark P
2014/10/21 21:28:22
If you change the name of the rule, please revise
Bart N.
2014/10/22 01:19:08
Done.
|
| +const char OmniboxFieldTrial::kSuggestPollingDelayMsRule[] = |
|
H Fung
2014/10/20 21:59:42
This is a param, not a rule?
Mark P
2014/10/21 21:28:22
It's a "rule". In this file, rule correspond to t
Bart N.
2014/10/22 01:19:08
Acknowledged.
Bart N.
2014/10/22 01:19:08
Acknowledged.
|
| + "SuggestPollingDelayMs"; |
| const char OmniboxFieldTrial::kHUPNewScoringEnabledParam[] = |
| "HUPExperimentalScoringEnabled"; |