| 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::DisplayHintTextWhenPossible() { |
| 422 return chrome_variations::GetVariationParamValue( |
| 423 kBundledExperimentFieldTrialName, |
| 424 kDisplayHintTextWhenPossibleRule) == "true"; |
| 425 } |
| 426 |
| 421 const char OmniboxFieldTrial::kBundledExperimentFieldTrialName[] = | 427 const char OmniboxFieldTrial::kBundledExperimentFieldTrialName[] = |
| 422 "OmniboxBundledExperimentV1"; | 428 "OmniboxBundledExperimentV1"; |
| 429 const char OmniboxFieldTrial::kDisplayHintTextWhenPossibleRule[] = |
| 430 "DisplayHintTextWhenPossible"; |
| 423 const char OmniboxFieldTrial::kShortcutsScoringMaxRelevanceRule[] = | 431 const char OmniboxFieldTrial::kShortcutsScoringMaxRelevanceRule[] = |
| 424 "ShortcutsScoringMaxRelevance"; | 432 "ShortcutsScoringMaxRelevance"; |
| 425 const char OmniboxFieldTrial::kSearchHistoryRule[] = "SearchHistory"; | 433 const char OmniboxFieldTrial::kSearchHistoryRule[] = "SearchHistory"; |
| 426 const char OmniboxFieldTrial::kDemoteByTypeRule[] = "DemoteByType"; | 434 const char OmniboxFieldTrial::kDemoteByTypeRule[] = "DemoteByType"; |
| 427 const char OmniboxFieldTrial::kHQPBookmarkValueRule[] = | 435 const char OmniboxFieldTrial::kHQPBookmarkValueRule[] = |
| 428 "HQPBookmarkValue"; | 436 "HQPBookmarkValue"; |
| 429 const char OmniboxFieldTrial::kHQPAllowMatchInTLDRule[] = "HQPAllowMatchInTLD"; | 437 const char OmniboxFieldTrial::kHQPAllowMatchInTLDRule[] = "HQPAllowMatchInTLD"; |
| 430 const char OmniboxFieldTrial::kHQPAllowMatchInSchemeRule[] = | 438 const char OmniboxFieldTrial::kHQPAllowMatchInSchemeRule[] = |
| 431 "HQPAllowMatchInScheme"; | 439 "HQPAllowMatchInScheme"; |
| 432 const char OmniboxFieldTrial::kZeroSuggestRule[] = "ZeroSuggest"; | 440 const char OmniboxFieldTrial::kZeroSuggestRule[] = "ZeroSuggest"; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 if (it != params.end()) | 510 if (it != params.end()) |
| 503 return it->second; | 511 return it->second; |
| 504 // Fall back to the global instant extended context. | 512 // Fall back to the global instant extended context. |
| 505 it = params.find(rule + ":" + page_classification_str + ":*"); | 513 it = params.find(rule + ":" + page_classification_str + ":*"); |
| 506 if (it != params.end()) | 514 if (it != params.end()) |
| 507 return it->second; | 515 return it->second; |
| 508 // Look up rule in the global context. | 516 // Look up rule in the global context. |
| 509 it = params.find(rule + ":*:*"); | 517 it = params.find(rule + ":*:*"); |
| 510 return (it != params.end()) ? it->second : std::string(); | 518 return (it != params.end()) ? it->second : std::string(); |
| 511 } | 519 } |
| OLD | NEW |