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 "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" |
11 #include "base/metrics/field_trial.h" | 11 #include "base/metrics/field_trial.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "base/strings/string_split.h" | 13 #include "base/strings/string_split.h" |
14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
15 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
17 #include "chrome/common/chrome_switches.h" | |
18 #include "chrome/common/variations/variation_ids.h" | |
19 #include "components/metrics/proto/omnibox_event.pb.h" | 17 #include "components/metrics/proto/omnibox_event.pb.h" |
| 18 #include "components/omnibox/omnibox_switches.h" |
20 #include "components/search/search.h" | 19 #include "components/search/search.h" |
21 #include "components/variations/active_field_trials.h" | 20 #include "components/variations/active_field_trials.h" |
22 #include "components/variations/metrics_util.h" | 21 #include "components/variations/metrics_util.h" |
23 #include "components/variations/variations_associated_data.h" | 22 #include "components/variations/variations_associated_data.h" |
24 | 23 |
25 using metrics::OmniboxEventProto; | 24 using metrics::OmniboxEventProto; |
26 | 25 |
27 namespace { | 26 namespace { |
28 | 27 |
29 typedef std::map<std::string, std::string> VariationParams; | 28 typedef std::map<std::string, std::string> VariationParams; |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 if (it != params.end()) | 433 if (it != params.end()) |
435 return it->second; | 434 return it->second; |
436 // Fall back to the global instant extended context. | 435 // Fall back to the global instant extended context. |
437 it = params.find(rule + ":" + page_classification_str + ":*"); | 436 it = params.find(rule + ":" + page_classification_str + ":*"); |
438 if (it != params.end()) | 437 if (it != params.end()) |
439 return it->second; | 438 return it->second; |
440 // Look up rule in the global context. | 439 // Look up rule in the global context. |
441 it = params.find(rule + ":*:*"); | 440 it = params.find(rule + ":*:*"); |
442 return (it != params.end()) ? it->second : std::string(); | 441 return (it != params.end()) ? it->second : std::string(); |
443 } | 442 } |
OLD | NEW |