| 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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 kBundledExperimentFieldTrialName, | 418 kBundledExperimentFieldTrialName, |
| 419 kHQPAllowMatchInSchemeRule) == "true"; | 419 kHQPAllowMatchInSchemeRule) == "true"; |
| 420 } | 420 } |
| 421 | 421 |
| 422 bool OmniboxFieldTrial::BookmarksIndexURLsValue() { | 422 bool OmniboxFieldTrial::BookmarksIndexURLsValue() { |
| 423 return chrome_variations::GetVariationParamValue( | 423 return chrome_variations::GetVariationParamValue( |
| 424 kBundledExperimentFieldTrialName, | 424 kBundledExperimentFieldTrialName, |
| 425 kBookmarksIndexURLsRule) == "true"; | 425 kBookmarksIndexURLsRule) == "true"; |
| 426 } | 426 } |
| 427 | 427 |
| 428 bool OmniboxFieldTrial::DisableInlining() { |
| 429 return chrome_variations::GetVariationParamValue( |
| 430 kBundledExperimentFieldTrialName, |
| 431 kDisableInliningRule) == "true"; |
| 432 } |
| 433 |
| 428 const char OmniboxFieldTrial::kBundledExperimentFieldTrialName[] = | 434 const char OmniboxFieldTrial::kBundledExperimentFieldTrialName[] = |
| 429 "OmniboxBundledExperimentV1"; | 435 "OmniboxBundledExperimentV1"; |
| 430 const char OmniboxFieldTrial::kShortcutsScoringMaxRelevanceRule[] = | 436 const char OmniboxFieldTrial::kShortcutsScoringMaxRelevanceRule[] = |
| 431 "ShortcutsScoringMaxRelevance"; | 437 "ShortcutsScoringMaxRelevance"; |
| 432 const char OmniboxFieldTrial::kSearchHistoryRule[] = "SearchHistory"; | 438 const char OmniboxFieldTrial::kSearchHistoryRule[] = "SearchHistory"; |
| 433 const char OmniboxFieldTrial::kDemoteByTypeRule[] = "DemoteByType"; | 439 const char OmniboxFieldTrial::kDemoteByTypeRule[] = "DemoteByType"; |
| 434 const char OmniboxFieldTrial::kHQPBookmarkValueRule[] = | 440 const char OmniboxFieldTrial::kHQPBookmarkValueRule[] = |
| 435 "HQPBookmarkValue"; | 441 "HQPBookmarkValue"; |
| 436 const char OmniboxFieldTrial::kHQPAllowMatchInTLDRule[] = "HQPAllowMatchInTLD"; | 442 const char OmniboxFieldTrial::kHQPAllowMatchInTLDRule[] = "HQPAllowMatchInTLD"; |
| 437 const char OmniboxFieldTrial::kHQPAllowMatchInSchemeRule[] = | 443 const char OmniboxFieldTrial::kHQPAllowMatchInSchemeRule[] = |
| 438 "HQPAllowMatchInScheme"; | 444 "HQPAllowMatchInScheme"; |
| 439 const char OmniboxFieldTrial::kZeroSuggestRule[] = "ZeroSuggest"; | 445 const char OmniboxFieldTrial::kZeroSuggestRule[] = "ZeroSuggest"; |
| 440 const char OmniboxFieldTrial::kZeroSuggestVariantRule[] = "ZeroSuggestVariant"; | 446 const char OmniboxFieldTrial::kZeroSuggestVariantRule[] = "ZeroSuggestVariant"; |
| 441 const char OmniboxFieldTrial::kBookmarksIndexURLsRule[] = "BookmarksIndexURLs"; | 447 const char OmniboxFieldTrial::kBookmarksIndexURLsRule[] = "BookmarksIndexURLs"; |
| 448 const char OmniboxFieldTrial::kDisableInliningRule[] = "DisableInlining"; |
| 442 | 449 |
| 443 const char OmniboxFieldTrial::kHUPNewScoringEnabledParam[] = | 450 const char OmniboxFieldTrial::kHUPNewScoringEnabledParam[] = |
| 444 "HUPExperimentalScoringEnabled"; | 451 "HUPExperimentalScoringEnabled"; |
| 445 const char OmniboxFieldTrial::kHUPNewScoringTypedCountRelevanceCapParam[] = | 452 const char OmniboxFieldTrial::kHUPNewScoringTypedCountRelevanceCapParam[] = |
| 446 "TypedCountRelevanceCap"; | 453 "TypedCountRelevanceCap"; |
| 447 const char OmniboxFieldTrial::kHUPNewScoringTypedCountHalfLifeTimeParam[] = | 454 const char OmniboxFieldTrial::kHUPNewScoringTypedCountHalfLifeTimeParam[] = |
| 448 "TypedCountHalfLifeTime"; | 455 "TypedCountHalfLifeTime"; |
| 449 const char OmniboxFieldTrial::kHUPNewScoringTypedCountScoreBucketsParam[] = | 456 const char OmniboxFieldTrial::kHUPNewScoringTypedCountScoreBucketsParam[] = |
| 450 "TypedCountScoreBuckets"; | 457 "TypedCountScoreBuckets"; |
| 451 const char OmniboxFieldTrial::kHUPNewScoringVisitedCountRelevanceCapParam[] = | 458 const char OmniboxFieldTrial::kHUPNewScoringVisitedCountRelevanceCapParam[] = |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 if (it != params.end()) | 517 if (it != params.end()) |
| 511 return it->second; | 518 return it->second; |
| 512 // Fall back to the global instant extended context. | 519 // Fall back to the global instant extended context. |
| 513 it = params.find(rule + ":" + page_classification_str + ":*"); | 520 it = params.find(rule + ":" + page_classification_str + ":*"); |
| 514 if (it != params.end()) | 521 if (it != params.end()) |
| 515 return it->second; | 522 return it->second; |
| 516 // Look up rule in the global context. | 523 // Look up rule in the global context. |
| 517 it = params.find(rule + ":*:*"); | 524 it = params.find(rule + ":*:*"); |
| 518 return (it != params.end()) ? it->second : std::string(); | 525 return (it != params.end()) ? it->second : std::string(); |
| 519 } | 526 } |
| OLD | NEW |