OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ | 5 #ifndef COMPONENTS_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ |
6 #define COMPONENTS_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ | 6 #define COMPONENTS_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 263 |
264 // Returns true if the search provider should not be caching results. | 264 // Returns true if the search provider should not be caching results. |
265 static bool DisableResultsCaching(); | 265 static bool DisableResultsCaching(); |
266 | 266 |
267 // Returns how the search provider should poll Suggest. Currently, we support | 267 // Returns how the search provider should poll Suggest. Currently, we support |
268 // measuring polling delay from the last keystroke or last suggest request. | 268 // measuring polling delay from the last keystroke or last suggest request. |
269 static void GetSuggestPollingStrategy(bool* from_last_keystroke, | 269 static void GetSuggestPollingStrategy(bool* from_last_keystroke, |
270 int* polling_delay_ms); | 270 int* polling_delay_ms); |
271 | 271 |
272 // --------------------------------------------------------- | 272 // --------------------------------------------------------- |
| 273 // For HQP scoring related experiments to control the topicality and scoring |
| 274 // ranges of relevancy scores. |
| 275 |
| 276 // Returns true if HQP experimental scoring is enabled. Returns false if |
| 277 // |kHQPExperimentalScoringEnabledParam| is not specified in the field trial. |
| 278 static bool HQPExperimentalScoringEnabled(); |
| 279 |
| 280 // Returns the scoring buckets for HQP experiments. Returns empty string |
| 281 // in case |kHQPExperimentalScoringBucketsParam| or |
| 282 // |kHQPExperimentalScoringEnabledParam| is not specified in the |
| 283 // field trial. Scoring buckets are stored in string form giving mapping from |
| 284 // (topicality_score, frequency_score) to final relevance score. |
| 285 // Please see GetRelevancyScore() under |
| 286 // chrome/browser/history::ScoredHistoryMatch for details. |
| 287 static std::string HQPExperimentalScoringBuckets(); |
| 288 |
| 289 // Returns the topicality threshold for HQP experiments. Returns -1 if |
| 290 // |kHQPExperimentalScoringTopicalityThresholdParam| or |
| 291 // |kHQPExperimentalScoringEnabledParam| is not specified in the field trial. |
| 292 static float HQPExperimentalTopicalityThreshold(); |
| 293 |
| 294 // --------------------------------------------------------- |
273 // Exposed publicly for the sake of unittests. | 295 // Exposed publicly for the sake of unittests. |
274 static const char kBundledExperimentFieldTrialName[]; | 296 static const char kBundledExperimentFieldTrialName[]; |
275 // Rule names used by the bundled experiment. | 297 // Rule names used by the bundled experiment. |
276 static const char kDisableProvidersRule[]; | 298 static const char kDisableProvidersRule[]; |
277 static const char kShortcutsScoringMaxRelevanceRule[]; | 299 static const char kShortcutsScoringMaxRelevanceRule[]; |
278 static const char kSearchHistoryRule[]; | 300 static const char kSearchHistoryRule[]; |
279 static const char kDemoteByTypeRule[]; | 301 static const char kDemoteByTypeRule[]; |
280 static const char kHQPBookmarkValueRule[]; | 302 static const char kHQPBookmarkValueRule[]; |
281 static const char kHQPDiscountFrecencyWhenFewVisitsRule[]; | 303 static const char kHQPDiscountFrecencyWhenFewVisitsRule[]; |
282 static const char kHQPAllowMatchInTLDRule[]; | 304 static const char kHQPAllowMatchInTLDRule[]; |
283 static const char kHQPAllowMatchInSchemeRule[]; | 305 static const char kHQPAllowMatchInSchemeRule[]; |
284 static const char kZeroSuggestRule[]; | 306 static const char kZeroSuggestRule[]; |
285 static const char kZeroSuggestVariantRule[]; | 307 static const char kZeroSuggestVariantRule[]; |
286 static const char kAnswersInSuggestRule[]; | 308 static const char kAnswersInSuggestRule[]; |
287 static const char kDisplayHintTextWhenPossibleRule[]; | 309 static const char kDisplayHintTextWhenPossibleRule[]; |
288 static const char kDisableResultsCachingRule[]; | 310 static const char kDisableResultsCachingRule[]; |
289 static const char kMeasureSuggestPollingDelayFromLastKeystrokeRule[]; | 311 static const char kMeasureSuggestPollingDelayFromLastKeystrokeRule[]; |
290 static const char kSuggestPollingDelayMsRule[]; | 312 static const char kSuggestPollingDelayMsRule[]; |
291 | 313 |
292 // Parameter names used by the HUP new scoring experiments. | 314 // Parameter names used by the HUP new scoring experiments. |
293 static const char kHUPNewScoringEnabledParam[]; | 315 static const char kHUPNewScoringEnabledParam[]; |
294 static const char kHUPNewScoringTypedCountRelevanceCapParam[]; | 316 static const char kHUPNewScoringTypedCountRelevanceCapParam[]; |
295 static const char kHUPNewScoringTypedCountHalfLifeTimeParam[]; | 317 static const char kHUPNewScoringTypedCountHalfLifeTimeParam[]; |
296 static const char kHUPNewScoringTypedCountScoreBucketsParam[]; | 318 static const char kHUPNewScoringTypedCountScoreBucketsParam[]; |
297 static const char kHUPNewScoringVisitedCountRelevanceCapParam[]; | 319 static const char kHUPNewScoringVisitedCountRelevanceCapParam[]; |
298 static const char kHUPNewScoringVisitedCountHalfLifeTimeParam[]; | 320 static const char kHUPNewScoringVisitedCountHalfLifeTimeParam[]; |
299 static const char kHUPNewScoringVisitedCountScoreBucketsParam[]; | 321 static const char kHUPNewScoringVisitedCountScoreBucketsParam[]; |
300 | 322 |
| 323 // Parameter names used by the HQP experimental scoring experiments. |
| 324 static const char kHQPExperimentalScoringEnabledParam[]; |
| 325 static const char kHQPExperimentalScoringBucketsParam[]; |
| 326 static const char kHQPExperimentalScoringTopicalityThresholdParam[]; |
| 327 |
301 // The amount of time to wait before sending a new suggest request after the | 328 // The amount of time to wait before sending a new suggest request after the |
302 // previous one unless overridden by a field trial parameter. | 329 // previous one unless overridden by a field trial parameter. |
303 // Non-const because some unittests modify this value. | 330 // Non-const because some unittests modify this value. |
304 static int kDefaultMinimumTimeBetweenSuggestQueriesMs; | 331 static int kDefaultMinimumTimeBetweenSuggestQueriesMs; |
305 | 332 |
306 private: | 333 private: |
307 friend class OmniboxFieldTrialTest; | 334 friend class OmniboxFieldTrialTest; |
308 | 335 |
309 // The bundled omnibox experiment comes with a set of parameters | 336 // The bundled omnibox experiment comes with a set of parameters |
310 // (key-value pairs). Each key indicates a certain rule that applies in | 337 // (key-value pairs). Each key indicates a certain rule that applies in |
(...skipping 11 matching lines...) Expand all Loading... |
322 // prioritize different wildcard contexts, see the implementation. How to | 349 // prioritize different wildcard contexts, see the implementation. How to |
323 // interpret the value is left to the caller; this is rule-dependent. | 350 // interpret the value is left to the caller; this is rule-dependent. |
324 static std::string GetValueForRuleInContext( | 351 static std::string GetValueForRuleInContext( |
325 const std::string& rule, | 352 const std::string& rule, |
326 metrics::OmniboxEventProto::PageClassification page_classification); | 353 metrics::OmniboxEventProto::PageClassification page_classification); |
327 | 354 |
328 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial); | 355 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial); |
329 }; | 356 }; |
330 | 357 |
331 #endif // COMPONENTS_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ | 358 #endif // COMPONENTS_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ |
OLD | NEW |