| 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/omnibox_field_trial.h" | 5 #include "components/omnibox/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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 return false; | 168 return false; |
| 169 #if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_LINUX) || \ | 169 #if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_LINUX) || \ |
| 170 (defined(OS_MACOSX) && !defined(OS_IOS)) | 170 (defined(OS_MACOSX) && !defined(OS_IOS)) |
| 171 return true; | 171 return true; |
| 172 #else | 172 #else |
| 173 return false; | 173 return false; |
| 174 #endif | 174 #endif |
| 175 } | 175 } |
| 176 | 176 |
| 177 bool OmniboxFieldTrial::InZeroSuggestMostVisitedFieldTrial() { | 177 bool OmniboxFieldTrial::InZeroSuggestMostVisitedFieldTrial() { |
| 178 return InZeroSuggestMostVisitedWithoutSerpFieldTrial() || |
| 179 variations::GetVariationParamValue( |
| 180 kBundledExperimentFieldTrialName, |
| 181 kZeroSuggestVariantRule) == "MostVisited"; |
| 182 } |
| 183 |
| 184 bool OmniboxFieldTrial::InZeroSuggestMostVisitedWithoutSerpFieldTrial() { |
| 178 return variations::GetVariationParamValue( | 185 return variations::GetVariationParamValue( |
| 179 kBundledExperimentFieldTrialName, | 186 kBundledExperimentFieldTrialName, |
| 180 kZeroSuggestVariantRule) == "MostVisited"; | 187 kZeroSuggestVariantRule) == "MostVisitedWithoutSERP"; |
| 181 } | 188 } |
| 182 | 189 |
| 183 bool OmniboxFieldTrial::InZeroSuggestAfterTypingFieldTrial() { | 190 bool OmniboxFieldTrial::InZeroSuggestAfterTypingFieldTrial() { |
| 184 return variations::GetVariationParamValue( | 191 return variations::GetVariationParamValue( |
| 185 kBundledExperimentFieldTrialName, | 192 kBundledExperimentFieldTrialName, |
| 186 kZeroSuggestVariantRule) == "AfterTyping"; | 193 kZeroSuggestVariantRule) == "AfterTyping"; |
| 187 } | 194 } |
| 188 | 195 |
| 189 bool OmniboxFieldTrial::InZeroSuggestPersonalizedFieldTrial() { | 196 bool OmniboxFieldTrial::InZeroSuggestPersonalizedFieldTrial() { |
| 190 return variations::GetVariationParamValue( | 197 return variations::GetVariationParamValue( |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 if (it != params.end()) | 433 if (it != params.end()) |
| 427 return it->second; | 434 return it->second; |
| 428 // Fall back to the global instant extended context. | 435 // Fall back to the global instant extended context. |
| 429 it = params.find(rule + ":" + page_classification_str + ":*"); | 436 it = params.find(rule + ":" + page_classification_str + ":*"); |
| 430 if (it != params.end()) | 437 if (it != params.end()) |
| 431 return it->second; | 438 return it->second; |
| 432 // Look up rule in the global context. | 439 // Look up rule in the global context. |
| 433 it = params.find(rule + ":*:*"); | 440 it = params.find(rule + ":*:*"); |
| 434 return (it != params.end()) ? it->second : std::string(); | 441 return (it != params.end()) ? it->second : std::string(); |
| 435 } | 442 } |
| OLD | NEW |