OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/omnibox/omnibox_field_trial.h" | 5 #include "chrome/browser/omnibox/omnibox_field_trial.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
424 kBundledExperimentFieldTrialName, | 424 kBundledExperimentFieldTrialName, |
425 kBookmarksIndexURLsRule) == "true"; | 425 kBookmarksIndexURLsRule) == "true"; |
426 } | 426 } |
427 | 427 |
428 bool OmniboxFieldTrial::DisableInlining() { | 428 bool OmniboxFieldTrial::DisableInlining() { |
429 return chrome_variations::GetVariationParamValue( | 429 return chrome_variations::GetVariationParamValue( |
430 kBundledExperimentFieldTrialName, | 430 kBundledExperimentFieldTrialName, |
431 kDisableInliningRule) == "true"; | 431 kDisableInliningRule) == "true"; |
432 } | 432 } |
433 | 433 |
434 bool OmniboxFieldTrial::EnableAnswersInSuggest() { | |
435 return chrome_variations::GetVariationParamValue( | |
436 kBundledExperimentFieldTrialName, | |
437 kAnswersInSuggestRule) == "true"; | |
438 } | |
439 | |
434 const char OmniboxFieldTrial::kBundledExperimentFieldTrialName[] = | 440 const char OmniboxFieldTrial::kBundledExperimentFieldTrialName[] = |
435 "OmniboxBundledExperimentV1"; | 441 "OmniboxBundledExperimentV1"; |
436 const char OmniboxFieldTrial::kShortcutsScoringMaxRelevanceRule[] = | 442 const char OmniboxFieldTrial::kShortcutsScoringMaxRelevanceRule[] = |
437 "ShortcutsScoringMaxRelevance"; | 443 "ShortcutsScoringMaxRelevance"; |
438 const char OmniboxFieldTrial::kSearchHistoryRule[] = "SearchHistory"; | 444 const char OmniboxFieldTrial::kSearchHistoryRule[] = "SearchHistory"; |
439 const char OmniboxFieldTrial::kDemoteByTypeRule[] = "DemoteByType"; | 445 const char OmniboxFieldTrial::kDemoteByTypeRule[] = "DemoteByType"; |
440 const char OmniboxFieldTrial::kHQPBookmarkValueRule[] = | 446 const char OmniboxFieldTrial::kHQPBookmarkValueRule[] = |
441 "HQPBookmarkValue"; | 447 "HQPBookmarkValue"; |
442 const char OmniboxFieldTrial::kHQPAllowMatchInTLDRule[] = "HQPAllowMatchInTLD"; | 448 const char OmniboxFieldTrial::kHQPAllowMatchInTLDRule[] = "HQPAllowMatchInTLD"; |
443 const char OmniboxFieldTrial::kHQPAllowMatchInSchemeRule[] = | 449 const char OmniboxFieldTrial::kHQPAllowMatchInSchemeRule[] = |
444 "HQPAllowMatchInScheme"; | 450 "HQPAllowMatchInScheme"; |
445 const char OmniboxFieldTrial::kZeroSuggestRule[] = "ZeroSuggest"; | 451 const char OmniboxFieldTrial::kZeroSuggestRule[] = "ZeroSuggest"; |
446 const char OmniboxFieldTrial::kZeroSuggestVariantRule[] = "ZeroSuggestVariant"; | 452 const char OmniboxFieldTrial::kZeroSuggestVariantRule[] = "ZeroSuggestVariant"; |
447 const char OmniboxFieldTrial::kBookmarksIndexURLsRule[] = "BookmarksIndexURLs"; | 453 const char OmniboxFieldTrial::kBookmarksIndexURLsRule[] = "BookmarksIndexURLs"; |
448 const char OmniboxFieldTrial::kDisableInliningRule[] = "DisableInlining"; | 454 const char OmniboxFieldTrial::kDisableInliningRule[] = "DisableInlining"; |
455 const char OmniboxFieldTrial::kAnswersInSuggestRule[] = "AnswersInSuggest"; | |
Mark P
2014/06/19 23:50:21
I admit the above list in the .h / .cc has no sens
Justin Donnelly
2014/06/20 00:39:20
Oops, sorry about that. I thought I had this righ
| |
449 | 456 |
450 const char OmniboxFieldTrial::kHUPNewScoringEnabledParam[] = | 457 const char OmniboxFieldTrial::kHUPNewScoringEnabledParam[] = |
451 "HUPExperimentalScoringEnabled"; | 458 "HUPExperimentalScoringEnabled"; |
452 const char OmniboxFieldTrial::kHUPNewScoringTypedCountRelevanceCapParam[] = | 459 const char OmniboxFieldTrial::kHUPNewScoringTypedCountRelevanceCapParam[] = |
453 "TypedCountRelevanceCap"; | 460 "TypedCountRelevanceCap"; |
454 const char OmniboxFieldTrial::kHUPNewScoringTypedCountHalfLifeTimeParam[] = | 461 const char OmniboxFieldTrial::kHUPNewScoringTypedCountHalfLifeTimeParam[] = |
455 "TypedCountHalfLifeTime"; | 462 "TypedCountHalfLifeTime"; |
456 const char OmniboxFieldTrial::kHUPNewScoringTypedCountScoreBucketsParam[] = | 463 const char OmniboxFieldTrial::kHUPNewScoringTypedCountScoreBucketsParam[] = |
457 "TypedCountScoreBuckets"; | 464 "TypedCountScoreBuckets"; |
458 const char OmniboxFieldTrial::kHUPNewScoringVisitedCountRelevanceCapParam[] = | 465 const char OmniboxFieldTrial::kHUPNewScoringVisitedCountRelevanceCapParam[] = |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
517 if (it != params.end()) | 524 if (it != params.end()) |
518 return it->second; | 525 return it->second; |
519 // Fall back to the global instant extended context. | 526 // Fall back to the global instant extended context. |
520 it = params.find(rule + ":" + page_classification_str + ":*"); | 527 it = params.find(rule + ":" + page_classification_str + ":*"); |
521 if (it != params.end()) | 528 if (it != params.end()) |
522 return it->second; | 529 return it->second; |
523 // Look up rule in the global context. | 530 // Look up rule in the global context. |
524 it = params.find(rule + ":*:*"); | 531 it = params.find(rule + ":*:*"); |
525 return (it != params.end()) ? it->second : std::string(); | 532 return (it != params.end()) ? it->second : std::string(); |
526 } | 533 } |
OLD | NEW |