| 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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 kBundledExperimentFieldTrialName, | 437 kBundledExperimentFieldTrialName, |
| 438 kHQPAllowMatchInTLDRule) == "true"; | 438 kHQPAllowMatchInTLDRule) == "true"; |
| 439 } | 439 } |
| 440 | 440 |
| 441 bool OmniboxFieldTrial::HQPAllowMatchInSchemeValue() { | 441 bool OmniboxFieldTrial::HQPAllowMatchInSchemeValue() { |
| 442 return chrome_variations::GetVariationParamValue( | 442 return chrome_variations::GetVariationParamValue( |
| 443 kBundledExperimentFieldTrialName, | 443 kBundledExperimentFieldTrialName, |
| 444 kHQPAllowMatchInSchemeRule) == "true"; | 444 kHQPAllowMatchInSchemeRule) == "true"; |
| 445 } | 445 } |
| 446 | 446 |
| 447 bool OmniboxFieldTrial::BookmarksIndexURLsValue() { |
| 448 return chrome_variations::GetVariationParamValue( |
| 449 kBundledExperimentFieldTrialName, |
| 450 kBookmarksIndexURLsRule) == "true"; |
| 451 } |
| 452 |
| 447 const char OmniboxFieldTrial::kBundledExperimentFieldTrialName[] = | 453 const char OmniboxFieldTrial::kBundledExperimentFieldTrialName[] = |
| 448 "OmniboxBundledExperimentV1"; | 454 "OmniboxBundledExperimentV1"; |
| 449 const char OmniboxFieldTrial::kShortcutsScoringMaxRelevanceRule[] = | 455 const char OmniboxFieldTrial::kShortcutsScoringMaxRelevanceRule[] = |
| 450 "ShortcutsScoringMaxRelevance"; | 456 "ShortcutsScoringMaxRelevance"; |
| 451 const char OmniboxFieldTrial::kSearchHistoryRule[] = "SearchHistory"; | 457 const char OmniboxFieldTrial::kSearchHistoryRule[] = "SearchHistory"; |
| 452 const char OmniboxFieldTrial::kDemoteByTypeRule[] = "DemoteByType"; | 458 const char OmniboxFieldTrial::kDemoteByTypeRule[] = "DemoteByType"; |
| 453 const char OmniboxFieldTrial::kUndemotableTopTypeRule[] = "UndemotableTopTypes"; | 459 const char OmniboxFieldTrial::kUndemotableTopTypeRule[] = "UndemotableTopTypes"; |
| 454 const char OmniboxFieldTrial::kHQPBookmarkValueRule[] = | 460 const char OmniboxFieldTrial::kHQPBookmarkValueRule[] = |
| 455 "HQPBookmarkValue"; | 461 "HQPBookmarkValue"; |
| 456 const char OmniboxFieldTrial::kHQPAllowMatchInTLDRule[] = "HQPAllowMatchInTLD"; | 462 const char OmniboxFieldTrial::kHQPAllowMatchInTLDRule[] = "HQPAllowMatchInTLD"; |
| 457 const char OmniboxFieldTrial::kHQPAllowMatchInSchemeRule[] = | 463 const char OmniboxFieldTrial::kHQPAllowMatchInSchemeRule[] = |
| 458 "HQPAllowMatchInScheme"; | 464 "HQPAllowMatchInScheme"; |
| 459 const char OmniboxFieldTrial::kZeroSuggestRule[] = "ZeroSuggest"; | 465 const char OmniboxFieldTrial::kZeroSuggestRule[] = "ZeroSuggest"; |
| 460 const char OmniboxFieldTrial::kZeroSuggestVariantRule[] = "ZeroSuggestVariant"; | 466 const char OmniboxFieldTrial::kZeroSuggestVariantRule[] = "ZeroSuggestVariant"; |
| 467 const char OmniboxFieldTrial::kBookmarksIndexURLsRule[] = "BookmarksIndexURLs"; |
| 461 | 468 |
| 462 const char OmniboxFieldTrial::kHUPNewScoringEnabledParam[] = | 469 const char OmniboxFieldTrial::kHUPNewScoringEnabledParam[] = |
| 463 "HUPExperimentalScoringEnabled"; | 470 "HUPExperimentalScoringEnabled"; |
| 464 const char OmniboxFieldTrial::kHUPNewScoringTypedCountRelevanceCapParam[] = | 471 const char OmniboxFieldTrial::kHUPNewScoringTypedCountRelevanceCapParam[] = |
| 465 "TypedCountRelevanceCap"; | 472 "TypedCountRelevanceCap"; |
| 466 const char OmniboxFieldTrial::kHUPNewScoringTypedCountHalfLifeTimeParam[] = | 473 const char OmniboxFieldTrial::kHUPNewScoringTypedCountHalfLifeTimeParam[] = |
| 467 "TypedCountHalfLifeTime"; | 474 "TypedCountHalfLifeTime"; |
| 468 const char OmniboxFieldTrial::kHUPNewScoringTypedCountScoreBucketsParam[] = | 475 const char OmniboxFieldTrial::kHUPNewScoringTypedCountScoreBucketsParam[] = |
| 469 "TypedCountScoreBuckets"; | 476 "TypedCountScoreBuckets"; |
| 470 const char OmniboxFieldTrial::kHUPNewScoringVisitedCountRelevanceCapParam[] = | 477 const char OmniboxFieldTrial::kHUPNewScoringVisitedCountRelevanceCapParam[] = |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 if (it != params.end()) | 536 if (it != params.end()) |
| 530 return it->second; | 537 return it->second; |
| 531 // Fall back to the global instant extended context. | 538 // Fall back to the global instant extended context. |
| 532 it = params.find(rule + ":" + page_classification_str + ":*"); | 539 it = params.find(rule + ":" + page_classification_str + ":*"); |
| 533 if (it != params.end()) | 540 if (it != params.end()) |
| 534 return it->second; | 541 return it->second; |
| 535 // Look up rule in the global context. | 542 // Look up rule in the global context. |
| 536 it = params.find(rule + ":*:*"); | 543 it = params.find(rule + ":*:*"); |
| 537 return (it != params.end()) ? it->second : std::string(); | 544 return (it != params.end()) ? it->second : std::string(); |
| 538 } | 545 } |
| OLD | NEW |