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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 kHQPAllowMatchInSchemeRule) == "true"; | 306 kHQPAllowMatchInSchemeRule) == "true"; |
307 } | 307 } |
308 | 308 |
309 bool OmniboxFieldTrial::DisableInlining() { | 309 bool OmniboxFieldTrial::DisableInlining() { |
310 return variations::GetVariationParamValue( | 310 return variations::GetVariationParamValue( |
311 kBundledExperimentFieldTrialName, | 311 kBundledExperimentFieldTrialName, |
312 kDisableInliningRule) == "true"; | 312 kDisableInliningRule) == "true"; |
313 } | 313 } |
314 | 314 |
315 bool OmniboxFieldTrial::EnableAnswersInSuggest() { | 315 bool OmniboxFieldTrial::EnableAnswersInSuggest() { |
316 const CommandLine* cl = CommandLine::ForCurrentProcess(); | 316 return true; |
317 if (cl->HasSwitch(switches::kDisableAnswersInSuggest)) | |
318 return false; | |
319 if (cl->HasSwitch(switches::kEnableAnswersInSuggest)) | |
320 return true; | |
321 | |
322 return variations::GetVariationParamValue( | |
323 kBundledExperimentFieldTrialName, | |
324 kAnswersInSuggestRule) == "true"; | |
325 } | 317 } |
326 | 318 |
327 bool OmniboxFieldTrial::AddUWYTMatchEvenIfPromotedURLs() { | 319 bool OmniboxFieldTrial::AddUWYTMatchEvenIfPromotedURLs() { |
328 return variations::GetVariationParamValue( | 320 return variations::GetVariationParamValue( |
329 kBundledExperimentFieldTrialName, | 321 kBundledExperimentFieldTrialName, |
330 kAddUWYTMatchEvenIfPromotedURLsRule) == "true"; | 322 kAddUWYTMatchEvenIfPromotedURLsRule) == "true"; |
331 } | 323 } |
332 | 324 |
333 bool OmniboxFieldTrial::DisplayHintTextWhenPossible() { | 325 bool OmniboxFieldTrial::DisplayHintTextWhenPossible() { |
334 return variations::GetVariationParamValue( | 326 return variations::GetVariationParamValue( |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 if (it != params.end()) | 418 if (it != params.end()) |
427 return it->second; | 419 return it->second; |
428 // Fall back to the global instant extended context. | 420 // Fall back to the global instant extended context. |
429 it = params.find(rule + ":" + page_classification_str + ":*"); | 421 it = params.find(rule + ":" + page_classification_str + ":*"); |
430 if (it != params.end()) | 422 if (it != params.end()) |
431 return it->second; | 423 return it->second; |
432 // Look up rule in the global context. | 424 // Look up rule in the global context. |
433 it = params.find(rule + ":*:*"); | 425 it = params.find(rule + ":*:*"); |
434 return (it != params.end()) ? it->second : std::string(); | 426 return (it != params.end()) ? it->second : std::string(); |
435 } | 427 } |
OLD | NEW |