Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: chrome/browser/omnibox/omnibox_field_trial.cc

Issue 286063004: Move active field trial API to variations component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <cmath> 7 #include <cmath>
8 #include <string> 8 #include <string>
9 9
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
11 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
12 #include "base/strings/string_split.h" 12 #include "base/strings/string_split.h"
13 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
14 #include "base/strings/stringprintf.h" 14 #include "base/strings/stringprintf.h"
15 #include "base/time/time.h" 15 #include "base/time/time.h"
16 #include "chrome/browser/autocomplete/autocomplete_input.h" 16 #include "chrome/browser/autocomplete/autocomplete_input.h"
17 #include "chrome/browser/search/search.h" 17 #include "chrome/browser/search/search.h"
18 #include "chrome/common/metrics/variations/variation_ids.h" 18 #include "chrome/common/metrics/variations/variation_ids.h"
19 #include "chrome/common/metrics/variations/variations_util.h" 19 #include "components/variations/active_field_trials.h"
20 #include "components/variations/metrics_util.h" 20 #include "components/variations/metrics_util.h"
21 #include "components/variations/variations_associated_data.h"
21 22
22 namespace { 23 namespace {
23 24
24 typedef std::map<std::string, std::string> VariationParams; 25 typedef std::map<std::string, std::string> VariationParams;
25 typedef HUPScoringParams::ScoreBuckets ScoreBuckets; 26 typedef HUPScoringParams::ScoreBuckets ScoreBuckets;
26 27
27 // Field trial names. 28 // Field trial names.
28 const char kHUPCullRedirectsFieldTrialName[] = "OmniboxHUPCullRedirects"; 29 const char kHUPCullRedirectsFieldTrialName[] = "OmniboxHUPCullRedirects";
29 const char kHUPCreateShorterMatchFieldTrialName[] = 30 const char kHUPCreateShorterMatchFieldTrialName[] =
30 "OmniboxHUPCreateShorterMatch"; 31 "OmniboxHUPCreateShorterMatch";
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 if (it != params.end()) 510 if (it != params.end())
510 return it->second; 511 return it->second;
511 // Fall back to the global instant extended context. 512 // Fall back to the global instant extended context.
512 it = params.find(rule + ":" + page_classification_str + ":*"); 513 it = params.find(rule + ":" + page_classification_str + ":*");
513 if (it != params.end()) 514 if (it != params.end())
514 return it->second; 515 return it->second;
515 // Look up rule in the global context. 516 // Look up rule in the global context.
516 it = params.find(rule + ":*:*"); 517 it = params.find(rule + ":*:*");
517 return (it != params.end()) ? it->second : std::string(); 518 return (it != params.end()) ? it->second : std::string();
518 } 519 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/metrics_service_unittest.cc ('k') | chrome/browser/omnibox/omnibox_field_trial_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698