| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/omnibox/browser/omnibox_field_trial.h" | 5 #include "components/omnibox/browser/omnibox_field_trial.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 // Feature used for the Zero Suggest Redirect to Chrome Field Trial. | 70 // Feature used for the Zero Suggest Redirect to Chrome Field Trial. |
| 71 const base::Feature kZeroSuggestRedirectToChrome{ | 71 const base::Feature kZeroSuggestRedirectToChrome{ |
| 72 "ZeroSuggestRedirectToChrome", base::FEATURE_DISABLED_BY_DEFAULT}; | 72 "ZeroSuggestRedirectToChrome", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 73 | 73 |
| 74 // Feature used to swap the title and URL when providing zero suggest | 74 // Feature used to swap the title and URL when providing zero suggest |
| 75 // suggestions. | 75 // suggestions. |
| 76 const base::Feature kZeroSuggestSwapTitleAndUrl{ | 76 const base::Feature kZeroSuggestSwapTitleAndUrl{ |
| 77 "ZeroSuggestSwapTitleAndUrl", base::FEATURE_DISABLED_BY_DEFAULT}; | 77 "ZeroSuggestSwapTitleAndUrl", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 78 | 78 |
| 79 // Feature used to display the title of the current URL match. |
| 80 const base::Feature kDisplayTitleForCurrentUrl{ |
| 81 "OmniboxDisplayTitleForCurrentUrl", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 82 |
| 79 } // namespace omnibox | 83 } // namespace omnibox |
| 80 | 84 |
| 81 namespace { | 85 namespace { |
| 82 | 86 |
| 83 typedef std::map<std::string, std::string> VariationParams; | 87 typedef std::map<std::string, std::string> VariationParams; |
| 84 typedef HUPScoringParams::ScoreBuckets ScoreBuckets; | 88 typedef HUPScoringParams::ScoreBuckets ScoreBuckets; |
| 85 | 89 |
| 86 // Field trial names. | 90 // Field trial names. |
| 87 const char kStopTimerFieldTrialName[] = "OmniboxStopTimer"; | 91 const char kStopTimerFieldTrialName[] = "OmniboxStopTimer"; |
| 88 | 92 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 metrics::HashName(kBundledExperimentFieldTrialName)); | 189 metrics::HashName(kBundledExperimentFieldTrialName)); |
| 186 } | 190 } |
| 187 } | 191 } |
| 188 | 192 |
| 189 base::TimeDelta OmniboxFieldTrial::StopTimerFieldTrialDuration() { | 193 base::TimeDelta OmniboxFieldTrial::StopTimerFieldTrialDuration() { |
| 190 int stop_timer_ms; | 194 int stop_timer_ms; |
| 191 if (base::StringToInt( | 195 if (base::StringToInt( |
| 192 base::FieldTrialList::FindFullName(kStopTimerFieldTrialName), | 196 base::FieldTrialList::FindFullName(kStopTimerFieldTrialName), |
| 193 &stop_timer_ms)) | 197 &stop_timer_ms)) |
| 194 return base::TimeDelta::FromMilliseconds(stop_timer_ms); | 198 return base::TimeDelta::FromMilliseconds(stop_timer_ms); |
| 195 return base::TimeDelta::FromMilliseconds(1500); | 199 return base::TimeDelta::FromMilliseconds(5500); |
| 196 } | 200 } |
| 197 | 201 |
| 198 bool OmniboxFieldTrial::InZeroSuggestFieldTrial() { | 202 bool OmniboxFieldTrial::InZeroSuggestFieldTrial() { |
| 199 if (variations::GetVariationParamValue( | 203 if (variations::GetVariationParamValue( |
| 200 kBundledExperimentFieldTrialName, kZeroSuggestRule) == "true") | 204 kBundledExperimentFieldTrialName, kZeroSuggestRule) == "true") |
| 201 return true; | 205 return true; |
| 202 if (variations::GetVariationParamValue( | 206 if (variations::GetVariationParamValue( |
| 203 kBundledExperimentFieldTrialName, kZeroSuggestRule) == "false") | 207 kBundledExperimentFieldTrialName, kZeroSuggestRule) == "false") |
| 204 return false; | 208 return false; |
| 205 #if defined(OS_IOS) | 209 #if defined(OS_IOS) |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 if (it != params.end()) | 794 if (it != params.end()) |
| 791 return it->second; | 795 return it->second; |
| 792 // Fall back to the global instant extended context. | 796 // Fall back to the global instant extended context. |
| 793 it = params.find(rule + ":" + page_classification_str + ":*"); | 797 it = params.find(rule + ":" + page_classification_str + ":*"); |
| 794 if (it != params.end()) | 798 if (it != params.end()) |
| 795 return it->second; | 799 return it->second; |
| 796 // Look up rule in the global context. | 800 // Look up rule in the global context. |
| 797 it = params.find(rule + ":*:*"); | 801 it = params.find(rule + ":*:*"); |
| 798 return (it != params.end()) ? it->second : std::string(); | 802 return (it != params.end()) ? it->second : std::string(); |
| 799 } | 803 } |
| OLD | NEW |