| 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 kHQPAllowMatchInSchemeRule) == "true"; | 301 kHQPAllowMatchInSchemeRule) == "true"; |
| 302 } | 302 } |
| 303 | 303 |
| 304 bool OmniboxFieldTrial::DisableInlining() { | 304 bool OmniboxFieldTrial::DisableInlining() { |
| 305 return variations::GetVariationParamValue( | 305 return variations::GetVariationParamValue( |
| 306 kBundledExperimentFieldTrialName, | 306 kBundledExperimentFieldTrialName, |
| 307 kDisableInliningRule) == "true"; | 307 kDisableInliningRule) == "true"; |
| 308 } | 308 } |
| 309 | 309 |
| 310 bool OmniboxFieldTrial::EnableAnswersInSuggest() { | 310 bool OmniboxFieldTrial::EnableAnswersInSuggest() { |
| 311 const CommandLine* cl = CommandLine::ForCurrentProcess(); | 311 const base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); |
| 312 if (cl->HasSwitch(switches::kDisableAnswersInSuggest)) | 312 if (cl->HasSwitch(switches::kDisableAnswersInSuggest)) |
| 313 return false; | 313 return false; |
| 314 if (cl->HasSwitch(switches::kEnableAnswersInSuggest)) | 314 if (cl->HasSwitch(switches::kEnableAnswersInSuggest)) |
| 315 return true; | 315 return true; |
| 316 | 316 |
| 317 return variations::GetVariationParamValue( | 317 return variations::GetVariationParamValue( |
| 318 kBundledExperimentFieldTrialName, | 318 kBundledExperimentFieldTrialName, |
| 319 kAnswersInSuggestRule) == "true"; | 319 kAnswersInSuggestRule) == "true"; |
| 320 } | 320 } |
| 321 | 321 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 if (it != params.end()) | 454 if (it != params.end()) |
| 455 return it->second; | 455 return it->second; |
| 456 // Fall back to the global instant extended context. | 456 // Fall back to the global instant extended context. |
| 457 it = params.find(rule + ":" + page_classification_str + ":*"); | 457 it = params.find(rule + ":" + page_classification_str + ":*"); |
| 458 if (it != params.end()) | 458 if (it != params.end()) |
| 459 return it->second; | 459 return it->second; |
| 460 // Look up rule in the global context. | 460 // Look up rule in the global context. |
| 461 it = params.find(rule + ":*:*"); | 461 it = params.find(rule + ":*:*"); |
| 462 return (it != params.end()) ? it->second : std::string(); | 462 return (it != params.end()) ? it->second : std::string(); |
| 463 } | 463 } |
| OLD | NEW |