| 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 kBundledExperimentFieldTrialName, | 411 kBundledExperimentFieldTrialName, |
| 412 kHQPAllowMatchInTLDRule) == "true"; | 412 kHQPAllowMatchInTLDRule) == "true"; |
| 413 } | 413 } |
| 414 | 414 |
| 415 bool OmniboxFieldTrial::HQPAllowMatchInSchemeValue() { | 415 bool OmniboxFieldTrial::HQPAllowMatchInSchemeValue() { |
| 416 return chrome_variations::GetVariationParamValue( | 416 return chrome_variations::GetVariationParamValue( |
| 417 kBundledExperimentFieldTrialName, | 417 kBundledExperimentFieldTrialName, |
| 418 kHQPAllowMatchInSchemeRule) == "true"; | 418 kHQPAllowMatchInSchemeRule) == "true"; |
| 419 } | 419 } |
| 420 | 420 |
| 421 bool OmniboxFieldTrial::BookmarksIndexURLsValue() { |
| 422 return chrome_variations::GetVariationParamValue( |
| 423 kBundledExperimentFieldTrialName, |
| 424 kBookmarksIndexURLsRule) == "true"; |
| 425 } |
| 426 |
| 421 const char OmniboxFieldTrial::kBundledExperimentFieldTrialName[] = | 427 const char OmniboxFieldTrial::kBundledExperimentFieldTrialName[] = |
| 422 "OmniboxBundledExperimentV1"; | 428 "OmniboxBundledExperimentV1"; |
| 423 const char OmniboxFieldTrial::kShortcutsScoringMaxRelevanceRule[] = | 429 const char OmniboxFieldTrial::kShortcutsScoringMaxRelevanceRule[] = |
| 424 "ShortcutsScoringMaxRelevance"; | 430 "ShortcutsScoringMaxRelevance"; |
| 425 const char OmniboxFieldTrial::kSearchHistoryRule[] = "SearchHistory"; | 431 const char OmniboxFieldTrial::kSearchHistoryRule[] = "SearchHistory"; |
| 426 const char OmniboxFieldTrial::kDemoteByTypeRule[] = "DemoteByType"; | 432 const char OmniboxFieldTrial::kDemoteByTypeRule[] = "DemoteByType"; |
| 427 const char OmniboxFieldTrial::kHQPBookmarkValueRule[] = | 433 const char OmniboxFieldTrial::kHQPBookmarkValueRule[] = |
| 428 "HQPBookmarkValue"; | 434 "HQPBookmarkValue"; |
| 429 const char OmniboxFieldTrial::kHQPAllowMatchInTLDRule[] = "HQPAllowMatchInTLD"; | 435 const char OmniboxFieldTrial::kHQPAllowMatchInTLDRule[] = "HQPAllowMatchInTLD"; |
| 430 const char OmniboxFieldTrial::kHQPAllowMatchInSchemeRule[] = | 436 const char OmniboxFieldTrial::kHQPAllowMatchInSchemeRule[] = |
| 431 "HQPAllowMatchInScheme"; | 437 "HQPAllowMatchInScheme"; |
| 432 const char OmniboxFieldTrial::kZeroSuggestRule[] = "ZeroSuggest"; | 438 const char OmniboxFieldTrial::kZeroSuggestRule[] = "ZeroSuggest"; |
| 433 const char OmniboxFieldTrial::kZeroSuggestVariantRule[] = "ZeroSuggestVariant"; | 439 const char OmniboxFieldTrial::kZeroSuggestVariantRule[] = "ZeroSuggestVariant"; |
| 440 const char OmniboxFieldTrial::kBookmarksIndexURLsRule[] = "BookmarksIndexURLs"; |
| 434 | 441 |
| 435 const char OmniboxFieldTrial::kHUPNewScoringEnabledParam[] = | 442 const char OmniboxFieldTrial::kHUPNewScoringEnabledParam[] = |
| 436 "HUPExperimentalScoringEnabled"; | 443 "HUPExperimentalScoringEnabled"; |
| 437 const char OmniboxFieldTrial::kHUPNewScoringTypedCountRelevanceCapParam[] = | 444 const char OmniboxFieldTrial::kHUPNewScoringTypedCountRelevanceCapParam[] = |
| 438 "TypedCountRelevanceCap"; | 445 "TypedCountRelevanceCap"; |
| 439 const char OmniboxFieldTrial::kHUPNewScoringTypedCountHalfLifeTimeParam[] = | 446 const char OmniboxFieldTrial::kHUPNewScoringTypedCountHalfLifeTimeParam[] = |
| 440 "TypedCountHalfLifeTime"; | 447 "TypedCountHalfLifeTime"; |
| 441 const char OmniboxFieldTrial::kHUPNewScoringTypedCountScoreBucketsParam[] = | 448 const char OmniboxFieldTrial::kHUPNewScoringTypedCountScoreBucketsParam[] = |
| 442 "TypedCountScoreBuckets"; | 449 "TypedCountScoreBuckets"; |
| 443 const char OmniboxFieldTrial::kHUPNewScoringVisitedCountRelevanceCapParam[] = | 450 const char OmniboxFieldTrial::kHUPNewScoringVisitedCountRelevanceCapParam[] = |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 if (it != params.end()) | 509 if (it != params.end()) |
| 503 return it->second; | 510 return it->second; |
| 504 // Fall back to the global instant extended context. | 511 // Fall back to the global instant extended context. |
| 505 it = params.find(rule + ":" + page_classification_str + ":*"); | 512 it = params.find(rule + ":" + page_classification_str + ":*"); |
| 506 if (it != params.end()) | 513 if (it != params.end()) |
| 507 return it->second; | 514 return it->second; |
| 508 // Look up rule in the global context. | 515 // Look up rule in the global context. |
| 509 it = params.find(rule + ":*:*"); | 516 it = params.find(rule + ":*:*"); |
| 510 return (it != params.end()) ? it->second : std::string(); | 517 return (it != params.end()) ? it->second : std::string(); |
| 511 } | 518 } |
| OLD | NEW |