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 defined. | |
Mark P
2015/02/14 01:27:14
This last sentence is wrong. This variable is a s
Ashok vardhan
2015/02/17 01:23:53
Acknowledged.
| |
278 static bool HQPExperimentalScoringEnabled(); | |
279 | |
280 // Returns the scoring buckets for HQP experiments. Returns empty string | |
281 // in case |kHQPExperimentalScoringBucketsParam| is not defined. Scoring | |
282 // buckets are stored in string form giving mapping from (topicality_score, | |
283 // frequency_score) to final relevance score. Please see GetRelevancyScore() | |
284 // under chrome/browser/history::ScoredHistoryMatch for details. | |
285 static std::string HQPExperimentalScoringBuckets(); | |
286 | |
287 // Returns the topicality threshold for HQP experiments. Returns -1 if | |
288 // |kHQPExperimentalScoringTopicalityThresholdParam| is not defined. | |
289 static float HQPExperimentalTopicalityThreshold(); | |
290 | |
291 // --------------------------------------------------------- | |
273 // Exposed publicly for the sake of unittests. | 292 // Exposed publicly for the sake of unittests. |
274 static const char kBundledExperimentFieldTrialName[]; | 293 static const char kBundledExperimentFieldTrialName[]; |
275 // Rule names used by the bundled experiment. | 294 // Rule names used by the bundled experiment. |
276 static const char kDisableProvidersRule[]; | 295 static const char kDisableProvidersRule[]; |
277 static const char kShortcutsScoringMaxRelevanceRule[]; | 296 static const char kShortcutsScoringMaxRelevanceRule[]; |
278 static const char kSearchHistoryRule[]; | 297 static const char kSearchHistoryRule[]; |
279 static const char kDemoteByTypeRule[]; | 298 static const char kDemoteByTypeRule[]; |
280 static const char kHQPBookmarkValueRule[]; | 299 static const char kHQPBookmarkValueRule[]; |
281 static const char kHQPDiscountFrecencyWhenFewVisitsRule[]; | 300 static const char kHQPDiscountFrecencyWhenFewVisitsRule[]; |
282 static const char kHQPAllowMatchInTLDRule[]; | 301 static const char kHQPAllowMatchInTLDRule[]; |
283 static const char kHQPAllowMatchInSchemeRule[]; | 302 static const char kHQPAllowMatchInSchemeRule[]; |
284 static const char kZeroSuggestRule[]; | 303 static const char kZeroSuggestRule[]; |
285 static const char kZeroSuggestVariantRule[]; | 304 static const char kZeroSuggestVariantRule[]; |
286 static const char kAnswersInSuggestRule[]; | 305 static const char kAnswersInSuggestRule[]; |
287 static const char kDisplayHintTextWhenPossibleRule[]; | 306 static const char kDisplayHintTextWhenPossibleRule[]; |
288 static const char kDisableResultsCachingRule[]; | 307 static const char kDisableResultsCachingRule[]; |
289 static const char kMeasureSuggestPollingDelayFromLastKeystrokeRule[]; | 308 static const char kMeasureSuggestPollingDelayFromLastKeystrokeRule[]; |
290 static const char kSuggestPollingDelayMsRule[]; | 309 static const char kSuggestPollingDelayMsRule[]; |
291 | 310 |
292 // Parameter names used by the HUP new scoring experiments. | 311 // Parameter names used by the HUP new scoring experiments. |
293 static const char kHUPNewScoringEnabledParam[]; | 312 static const char kHUPNewScoringEnabledParam[]; |
294 static const char kHUPNewScoringTypedCountRelevanceCapParam[]; | 313 static const char kHUPNewScoringTypedCountRelevanceCapParam[]; |
295 static const char kHUPNewScoringTypedCountHalfLifeTimeParam[]; | 314 static const char kHUPNewScoringTypedCountHalfLifeTimeParam[]; |
296 static const char kHUPNewScoringTypedCountScoreBucketsParam[]; | 315 static const char kHUPNewScoringTypedCountScoreBucketsParam[]; |
297 static const char kHUPNewScoringVisitedCountRelevanceCapParam[]; | 316 static const char kHUPNewScoringVisitedCountRelevanceCapParam[]; |
298 static const char kHUPNewScoringVisitedCountHalfLifeTimeParam[]; | 317 static const char kHUPNewScoringVisitedCountHalfLifeTimeParam[]; |
299 static const char kHUPNewScoringVisitedCountScoreBucketsParam[]; | 318 static const char kHUPNewScoringVisitedCountScoreBucketsParam[]; |
300 | 319 |
320 // Parameter names used by the HQP experimental scoring experiments. | |
321 static const char kHQPExperimentalScoringEnabledParam[]; | |
322 static const char kHQPExperimentalScoringBucketsParam[]; | |
323 static const char kHQPExperimentalScoringTopicalityThresholdParam[]; | |
324 | |
301 // The amount of time to wait before sending a new suggest request after the | 325 // The amount of time to wait before sending a new suggest request after the |
302 // previous one unless overridden by a field trial parameter. | 326 // previous one unless overridden by a field trial parameter. |
303 // Non-const because some unittests modify this value. | 327 // Non-const because some unittests modify this value. |
304 static int kDefaultMinimumTimeBetweenSuggestQueriesMs; | 328 static int kDefaultMinimumTimeBetweenSuggestQueriesMs; |
305 | 329 |
306 private: | 330 private: |
307 friend class OmniboxFieldTrialTest; | 331 friend class OmniboxFieldTrialTest; |
308 | 332 |
309 // The bundled omnibox experiment comes with a set of parameters | 333 // The bundled omnibox experiment comes with a set of parameters |
310 // (key-value pairs). Each key indicates a certain rule that applies in | 334 // (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 | 346 // prioritize different wildcard contexts, see the implementation. How to |
323 // interpret the value is left to the caller; this is rule-dependent. | 347 // interpret the value is left to the caller; this is rule-dependent. |
324 static std::string GetValueForRuleInContext( | 348 static std::string GetValueForRuleInContext( |
325 const std::string& rule, | 349 const std::string& rule, |
326 metrics::OmniboxEventProto::PageClassification page_classification); | 350 metrics::OmniboxEventProto::PageClassification page_classification); |
327 | 351 |
328 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial); | 352 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial); |
329 }; | 353 }; |
330 | 354 |
331 #endif // COMPONENTS_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ | 355 #endif // COMPONENTS_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ |
OLD | NEW |