Chromium Code Reviews| 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_BROWSER_OMNIBOX_FIELD_TRIAL_H_ | 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_ |
| 6 #define COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_ | 6 #define COMPONENTS_OMNIBOX_BROWSER_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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 313 // bundled omnibox field trial. | 313 // bundled omnibox field trial. |
| 314 | 314 |
| 315 // Returns true if HistoryURL provider should prohibit the URL-what-you- | 315 // Returns true if HistoryURL provider should prohibit the URL-what-you- |
| 316 // typed match from being the legal default match for non-URL inputs. | 316 // typed match from being the legal default match for non-URL inputs. |
| 317 // If this behavior is active, some code in AutocompleteInput::Parse() also | 317 // If this behavior is active, some code in AutocompleteInput::Parse() also |
| 318 // gets disabled; this code is unnecessary given the not-allowed-to-be- | 318 // gets disabled; this code is unnecessary given the not-allowed-to-be- |
| 319 // default constraint. Returns false if the experiment isn't active. | 319 // default constraint. Returns false if the experiment isn't active. |
| 320 static bool PreventUWYTDefaultForNonURLInputs(); | 320 static bool PreventUWYTDefaultForNonURLInputs(); |
| 321 | 321 |
| 322 // --------------------------------------------------------- | 322 // --------------------------------------------------------- |
| 323 // For the aggressive keyword matching experiment that's part of the bundled | |
| 324 // omnibox field trial. | |
| 325 | |
| 326 // Returns whether KeywordProvider should consider the registry portion | |
| 327 // (e.g., co.uk) of keywords that look like hostnames as an important part of | |
| 328 // the keyword name for matching purposes. Returns true if the experiment | |
| 329 // isn't active. | |
| 330 static bool KeywordRequiresRegistry(); | |
| 331 | |
| 332 // Returns whether KeywordProvider should require, for keywords that look like | |
| 333 // hostnames, users to type a prefix of the hostname to match against them, | |
|
Peter Kasting
2015/11/12 20:36:10
Nit: Slightly awkward; rearrange:
For keywords th
Mark P
2015/11/12 21:42:48
Done. I kindof wanted to write it like that origi
| |
| 334 // rather than just the domain name portion. In other words, returns whether | |
| 335 // the prefix before the domain name should be considered important for | |
| 336 // matching purposes. Returns true if the experiment isn't active. | |
| 337 static bool KeywordRequiresPrefixMatch(); | |
| 338 | |
| 339 // Returns the relevance score that KeywordProvider should assign to keywords | |
| 340 // with sufficiently-complete matches, i.e., the user has typed all of the | |
| 341 // important part of the keyword. Returns -1 if the experiment isn't active. | |
| 342 static int KeywordScoreForSufficientlyCompleteMatch(); | |
| 343 | |
| 344 // --------------------------------------------------------- | |
| 323 // Exposed publicly for the sake of unittests. | 345 // Exposed publicly for the sake of unittests. |
| 324 static const char kBundledExperimentFieldTrialName[]; | 346 static const char kBundledExperimentFieldTrialName[]; |
| 325 // Rule names used by the bundled experiment. | 347 // Rule names used by the bundled experiment. |
| 326 static const char kDisableProvidersRule[]; | 348 static const char kDisableProvidersRule[]; |
| 327 static const char kShortcutsScoringMaxRelevanceRule[]; | 349 static const char kShortcutsScoringMaxRelevanceRule[]; |
| 328 static const char kSearchHistoryRule[]; | 350 static const char kSearchHistoryRule[]; |
| 329 static const char kDemoteByTypeRule[]; | 351 static const char kDemoteByTypeRule[]; |
| 330 static const char kHQPBookmarkValueRule[]; | 352 static const char kHQPBookmarkValueRule[]; |
| 331 static const char kHQPDiscountFrecencyWhenFewVisitsRule[]; | 353 static const char kHQPDiscountFrecencyWhenFewVisitsRule[]; |
| 332 static const char kHQPAllowMatchInTLDRule[]; | 354 static const char kHQPAllowMatchInTLDRule[]; |
| 333 static const char kHQPAllowMatchInSchemeRule[]; | 355 static const char kHQPAllowMatchInSchemeRule[]; |
| 334 static const char kZeroSuggestRule[]; | 356 static const char kZeroSuggestRule[]; |
| 335 static const char kZeroSuggestVariantRule[]; | 357 static const char kZeroSuggestVariantRule[]; |
| 336 static const char kSuggestVariantRule[]; | 358 static const char kSuggestVariantRule[]; |
| 337 static const char kDisableResultsCachingRule[]; | 359 static const char kDisableResultsCachingRule[]; |
| 338 static const char kMeasureSuggestPollingDelayFromLastKeystrokeRule[]; | 360 static const char kMeasureSuggestPollingDelayFromLastKeystrokeRule[]; |
| 339 static const char kSuggestPollingDelayMsRule[]; | 361 static const char kSuggestPollingDelayMsRule[]; |
| 340 static const char kHQPFixFrequencyScoringBugsRule[]; | 362 static const char kHQPFixFrequencyScoringBugsRule[]; |
| 341 static const char kHQPNumTitleWordsRule[]; | 363 static const char kHQPNumTitleWordsRule[]; |
| 342 static const char kHQPAlsoDoHUPLikeScoringRule[]; | 364 static const char kHQPAlsoDoHUPLikeScoringRule[]; |
| 343 static const char kPreventUWYTDefaultForNonURLInputsRule[]; | 365 static const char kPreventUWYTDefaultForNonURLInputsRule[]; |
| 366 static const char kKeywordRequiresRegistryRule[]; | |
| 367 static const char kKeywordRequiresPrefixMatchRule[]; | |
| 368 static const char kKeywordScoreForSufficientlyCompleteMatchRule[]; | |
| 344 | 369 |
| 345 // Parameter names used by the HUP new scoring experiments. | 370 // Parameter names used by the HUP new scoring experiments. |
| 346 static const char kHUPNewScoringEnabledParam[]; | 371 static const char kHUPNewScoringEnabledParam[]; |
| 347 static const char kHUPNewScoringTypedCountRelevanceCapParam[]; | 372 static const char kHUPNewScoringTypedCountRelevanceCapParam[]; |
| 348 static const char kHUPNewScoringTypedCountHalfLifeTimeParam[]; | 373 static const char kHUPNewScoringTypedCountHalfLifeTimeParam[]; |
| 349 static const char kHUPNewScoringTypedCountScoreBucketsParam[]; | 374 static const char kHUPNewScoringTypedCountScoreBucketsParam[]; |
| 350 static const char kHUPNewScoringTypedCountUseDecayFactorParam[]; | 375 static const char kHUPNewScoringTypedCountUseDecayFactorParam[]; |
| 351 static const char kHUPNewScoringVisitedCountRelevanceCapParam[]; | 376 static const char kHUPNewScoringVisitedCountRelevanceCapParam[]; |
| 352 static const char kHUPNewScoringVisitedCountHalfLifeTimeParam[]; | 377 static const char kHUPNewScoringVisitedCountHalfLifeTimeParam[]; |
| 353 static const char kHUPNewScoringVisitedCountScoreBucketsParam[]; | 378 static const char kHUPNewScoringVisitedCountScoreBucketsParam[]; |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 382 // prioritize different wildcard contexts, see the implementation. How to | 407 // prioritize different wildcard contexts, see the implementation. How to |
| 383 // interpret the value is left to the caller; this is rule-dependent. | 408 // interpret the value is left to the caller; this is rule-dependent. |
| 384 static std::string GetValueForRuleInContext( | 409 static std::string GetValueForRuleInContext( |
| 385 const std::string& rule, | 410 const std::string& rule, |
| 386 metrics::OmniboxEventProto::PageClassification page_classification); | 411 metrics::OmniboxEventProto::PageClassification page_classification); |
| 387 | 412 |
| 388 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial); | 413 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial); |
| 389 }; | 414 }; |
| 390 | 415 |
| 391 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_ | 416 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_ |
| OLD | NEW |