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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 367 // field trial. | 367 // field trial. |
| 368 | 368 |
| 369 // Returns the conditions under which the UI code should display the title | 369 // Returns the conditions under which the UI code should display the title |
| 370 // of a URL more prominently than the URL for an input of type |input_type|. | 370 // of a URL more prominently than the URL for an input of type |input_type|. |
| 371 // Normally the URL is displayed more prominently. Returns NEVER_EMPHASIZE | 371 // Normally the URL is displayed more prominently. Returns NEVER_EMPHASIZE |
| 372 // if the experiment isn't active. | 372 // if the experiment isn't active. |
| 373 static EmphasizeTitlesCondition GetEmphasizeTitlesConditionForInput( | 373 static EmphasizeTitlesCondition GetEmphasizeTitlesConditionForInput( |
| 374 metrics::OmniboxInputType::Type input_type); | 374 metrics::OmniboxInputType::Type input_type); |
| 375 | 375 |
| 376 // --------------------------------------------------------- | 376 // --------------------------------------------------------- |
| 377 // For PhysicalWebProvider related experiments. | |
| 378 | |
| 379 // Returns whether the user is in a Physical Web field trial where the | |
| 380 // PhysicalWebProvider should be used to get suggestions when the user clicks | |
| 381 // on the omnibox but has not typed anything yet. | |
| 382 static bool InPhysicalWebZeroSuggestFieldTrial(); | |
| 383 | |
| 384 // Returns whether the user is in a Physical Web field trial and URL-based | |
| 385 // suggestions can continue to appear after the user has started typing. | |
| 386 static bool InPhysicalWebAfterTypingFieldTrial(); | |
| 387 | |
| 388 // Returns the base relevance score for Physical Web omnibox suggestions when | |
| 389 // the user has clicked on the omnibox but has not typed anything yet. | |
| 390 static int GetPhysicalWebZeroSuggestBaseRelevance(); | |
| 391 | |
| 392 // Returns the base relevance score for Physical Web omnibox suggestions when | |
| 393 // the user has started typing in the omnibox. | |
| 394 static int GetPhysicalWebAfterTypingBaseRelevance(); | |
| 395 | |
| 396 // --------------------------------------------------------- | |
| 377 // Exposed publicly for the sake of unittests. | 397 // Exposed publicly for the sake of unittests. |
| 378 static const char kBundledExperimentFieldTrialName[]; | 398 static const char kBundledExperimentFieldTrialName[]; |
| 379 // Rule names used by the bundled experiment. | 399 // Rule names used by the bundled experiment. |
| 380 static const char kDisableProvidersRule[]; | 400 static const char kDisableProvidersRule[]; |
| 381 static const char kShortcutsScoringMaxRelevanceRule[]; | 401 static const char kShortcutsScoringMaxRelevanceRule[]; |
| 382 static const char kSearchHistoryRule[]; | 402 static const char kSearchHistoryRule[]; |
| 383 static const char kDemoteByTypeRule[]; | 403 static const char kDemoteByTypeRule[]; |
| 384 static const char kHQPBookmarkValueRule[]; | 404 static const char kHQPBookmarkValueRule[]; |
| 385 static const char kHQPTypedValueRule[]; | 405 static const char kHQPTypedValueRule[]; |
| 386 static const char kHQPDiscountFrecencyWhenFewVisitsRule[]; | 406 static const char kHQPDiscountFrecencyWhenFewVisitsRule[]; |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 398 static const char kHQPNumMatchesScoresRule[]; | 418 static const char kHQPNumMatchesScoresRule[]; |
| 399 static const char kHQPNumTitleWordsRule[]; | 419 static const char kHQPNumTitleWordsRule[]; |
| 400 static const char kHQPAlsoDoHUPLikeScoringRule[]; | 420 static const char kHQPAlsoDoHUPLikeScoringRule[]; |
| 401 static const char kHUPSearchDatabaseRule[]; | 421 static const char kHUPSearchDatabaseRule[]; |
| 402 static const char kPreventUWYTDefaultForNonURLInputsRule[]; | 422 static const char kPreventUWYTDefaultForNonURLInputsRule[]; |
| 403 static const char kKeywordRequiresRegistryRule[]; | 423 static const char kKeywordRequiresRegistryRule[]; |
| 404 static const char kKeywordRequiresPrefixMatchRule[]; | 424 static const char kKeywordRequiresPrefixMatchRule[]; |
| 405 static const char kKeywordScoreForSufficientlyCompleteMatchRule[]; | 425 static const char kKeywordScoreForSufficientlyCompleteMatchRule[]; |
| 406 static const char kHQPAllowDupMatchesForScoringRule[]; | 426 static const char kHQPAllowDupMatchesForScoringRule[]; |
| 407 static const char kEmphasizeTitlesRule[]; | 427 static const char kEmphasizeTitlesRule[]; |
| 428 static const char kPhysicalWebZeroSuggestRule[]; | |
| 429 static const char kPhysicalWebAfterTypingRule[]; | |
| 408 | 430 |
| 409 // Parameter names used by the HUP new scoring experiments. | 431 // Parameter names used by the HUP new scoring experiments. |
| 410 static const char kHUPNewScoringEnabledParam[]; | 432 static const char kHUPNewScoringEnabledParam[]; |
| 411 static const char kHUPNewScoringTypedCountRelevanceCapParam[]; | 433 static const char kHUPNewScoringTypedCountRelevanceCapParam[]; |
| 412 static const char kHUPNewScoringTypedCountHalfLifeTimeParam[]; | 434 static const char kHUPNewScoringTypedCountHalfLifeTimeParam[]; |
| 413 static const char kHUPNewScoringTypedCountScoreBucketsParam[]; | 435 static const char kHUPNewScoringTypedCountScoreBucketsParam[]; |
| 414 static const char kHUPNewScoringTypedCountUseDecayFactorParam[]; | 436 static const char kHUPNewScoringTypedCountUseDecayFactorParam[]; |
| 415 static const char kHUPNewScoringVisitedCountRelevanceCapParam[]; | 437 static const char kHUPNewScoringVisitedCountRelevanceCapParam[]; |
| 416 static const char kHUPNewScoringVisitedCountHalfLifeTimeParam[]; | 438 static const char kHUPNewScoringVisitedCountHalfLifeTimeParam[]; |
| 417 static const char kHUPNewScoringVisitedCountScoreBucketsParam[]; | 439 static const char kHUPNewScoringVisitedCountScoreBucketsParam[]; |
| 418 static const char kHUPNewScoringVisitedCountUseDecayFactorParam[]; | 440 static const char kHUPNewScoringVisitedCountUseDecayFactorParam[]; |
| 419 | 441 |
| 420 // Parameter names used by the HQP experimental scoring experiments. | 442 // Parameter names used by the HQP experimental scoring experiments. |
| 421 static const char kHQPExperimentalScoringBucketsParam[]; | 443 static const char kHQPExperimentalScoringBucketsParam[]; |
| 422 static const char kHQPExperimentalScoringTopicalityThresholdParam[]; | 444 static const char kHQPExperimentalScoringTopicalityThresholdParam[]; |
| 423 | 445 |
| 446 // Parameter names used by the Physical Web experimental scoring experiments. | |
| 447 static const char kPhysicalWebExperimentalScoringParam[]; | |
|
Mark P
2016/12/22 04:58:16
nit: no longer needed
mattreynolds
2017/01/04 01:04:03
Done.
| |
| 448 static const char kPhysicalWebZeroSuggestBaseRelevanceParam[]; | |
| 449 static const char kPhysicalWebAfterTypingBaseRelevanceParam[]; | |
| 450 | |
| 424 // The amount of time to wait before sending a new suggest request after the | 451 // The amount of time to wait before sending a new suggest request after the |
| 425 // previous one unless overridden by a field trial parameter. | 452 // previous one unless overridden by a field trial parameter. |
| 426 // Non-const because some unittests modify this value. | 453 // Non-const because some unittests modify this value. |
| 427 static int kDefaultMinimumTimeBetweenSuggestQueriesMs; | 454 static int kDefaultMinimumTimeBetweenSuggestQueriesMs; |
| 428 | 455 |
| 429 private: | 456 private: |
| 430 friend class OmniboxFieldTrialTest; | 457 friend class OmniboxFieldTrialTest; |
| 431 | 458 |
| 432 // The bundled omnibox experiment comes with a set of parameters | 459 // The bundled omnibox experiment comes with a set of parameters |
| 433 // (key-value pairs). Each key indicates a certain rule that applies in | 460 // (key-value pairs). Each key indicates a certain rule that applies in |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 445 // prioritize different wildcard contexts, see the implementation. How to | 472 // prioritize different wildcard contexts, see the implementation. How to |
| 446 // interpret the value is left to the caller; this is rule-dependent. | 473 // interpret the value is left to the caller; this is rule-dependent. |
| 447 static std::string GetValueForRuleInContext( | 474 static std::string GetValueForRuleInContext( |
| 448 const std::string& rule, | 475 const std::string& rule, |
| 449 metrics::OmniboxEventProto::PageClassification page_classification); | 476 metrics::OmniboxEventProto::PageClassification page_classification); |
| 450 | 477 |
| 451 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial); | 478 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial); |
| 452 }; | 479 }; |
| 453 | 480 |
| 454 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_ | 481 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_ |
| OLD | NEW |