| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| 11 #include "base/strings/string_split.h" | 11 #include "base/strings/string_split.h" |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
| 14 #include "chrome/browser/autocomplete/autocomplete_input.h" | 14 #include "chrome/browser/autocomplete/autocomplete_input.h" |
| 15 #include "chrome/browser/search/search.h" | 15 #include "chrome/browser/search/search.h" |
| 16 #include "chrome/common/metrics/metrics_util.h" | |
| 17 #include "chrome/common/metrics/variations/variation_ids.h" | 16 #include "chrome/common/metrics/variations/variation_ids.h" |
| 18 #include "chrome/common/metrics/variations/variations_util.h" | 17 #include "chrome/common/metrics/variations/variations_util.h" |
| 18 #include "components/variations/metrics_util.h" |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 // Field trial names. | 22 // Field trial names. |
| 23 const char kHUPCullRedirectsFieldTrialName[] = "OmniboxHUPCullRedirects"; | 23 const char kHUPCullRedirectsFieldTrialName[] = "OmniboxHUPCullRedirects"; |
| 24 const char kHUPCreateShorterMatchFieldTrialName[] = | 24 const char kHUPCreateShorterMatchFieldTrialName[] = |
| 25 "OmniboxHUPCreateShorterMatch"; | 25 "OmniboxHUPCreateShorterMatch"; |
| 26 const char kStopTimerFieldTrialName[] = "OmniboxStopTimer"; | 26 const char kStopTimerFieldTrialName[] = "OmniboxStopTimer"; |
| 27 | 27 |
| 28 // The autocomplete dynamic field trial name prefix. Each field trial is | 28 // The autocomplete dynamic field trial name prefix. Each field trial is |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 if (it != params.end()) | 326 if (it != params.end()) |
| 327 return it->second; | 327 return it->second; |
| 328 // Fall back to the global instant extended context. | 328 // Fall back to the global instant extended context. |
| 329 it = params.find(rule + ":" + page_classification_str + ":*"); | 329 it = params.find(rule + ":" + page_classification_str + ":*"); |
| 330 if (it != params.end()) | 330 if (it != params.end()) |
| 331 return it->second; | 331 return it->second; |
| 332 // Look up rule in the global context. | 332 // Look up rule in the global context. |
| 333 it = params.find(rule + ":*:*"); | 333 it = params.find(rule + ":*:*"); |
| 334 return (it != params.end()) ? it->second : std::string(); | 334 return (it != params.end()) ? it->second : std::string(); |
| 335 } | 335 } |
| OLD | NEW |