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/prerender/prerender_field_trial.h" | 5 #include "chrome/browser/prerender/prerender_field_trial.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
11 #include "chrome/browser/autocomplete/network_action_predictor.h" | |
12 #include "chrome/browser/metrics/metrics_service.h" | 11 #include "chrome/browser/metrics/metrics_service.h" |
| 12 #include "chrome/browser/predictors/autocomplete_action_predictor.h" |
13 #include "chrome/browser/prefs/pref_service.h" | 13 #include "chrome/browser/prefs/pref_service.h" |
14 #include "chrome/browser/prerender/prerender_manager.h" | 14 #include "chrome/browser/prerender/prerender_manager.h" |
15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
17 #include "chrome/common/chrome_version_info.h" | 17 #include "chrome/common/chrome_version_info.h" |
18 | 18 |
19 namespace prerender { | 19 namespace prerender { |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 "OmniboxPrerenderHitWeightingTrial", kDivisor, | 210 "OmniboxPrerenderHitWeightingTrial", kDivisor, |
211 "OmniboxPrerenderWeight1.0", 2012, 8, 30, NULL)); | 211 "OmniboxPrerenderWeight1.0", 2012, 8, 30, NULL)); |
212 const int kOmniboxWeightFourGroup = | 212 const int kOmniboxWeightFourGroup = |
213 weighting_trial->AppendGroup("OmniboxPrerenderWeight4.0", | 213 weighting_trial->AppendGroup("OmniboxPrerenderWeight4.0", |
214 kFourProbability); | 214 kFourProbability); |
215 const int kOmniboxWeightEightGroup = | 215 const int kOmniboxWeightEightGroup = |
216 weighting_trial->AppendGroup("OmniboxPrerenderWeight8.0", | 216 weighting_trial->AppendGroup("OmniboxPrerenderWeight8.0", |
217 kEightProbability); | 217 kEightProbability); |
218 const int group = weighting_trial->group(); | 218 const int group = weighting_trial->group(); |
219 if (group == kOmniboxWeightFourGroup) | 219 if (group == kOmniboxWeightFourGroup) |
220 NetworkActionPredictor::set_hit_weight(4.0); | 220 AutocompleteActionPredictor::set_hit_weight(4.0); |
221 else if (group == kOmniboxWeightEightGroup) | 221 else if (group == kOmniboxWeightEightGroup) |
222 NetworkActionPredictor::set_hit_weight(8.0); | 222 AutocompleteActionPredictor::set_hit_weight(8.0); |
223 } | 223 } |
224 | 224 |
225 bool IsOmniboxEnabled(Profile* profile) { | 225 bool IsOmniboxEnabled(Profile* profile) { |
226 if (!profile || profile->IsOffTheRecord()) | 226 if (!profile || profile->IsOffTheRecord()) |
227 return false; | 227 return false; |
228 | 228 |
229 if (!PrerenderManager::IsPrerenderingPossible()) | 229 if (!PrerenderManager::IsPrerenderingPossible()) |
230 return false; | 230 return false; |
231 | 231 |
232 // Override any field trial groups if the user has set a command line flag. | 232 // Override any field trial groups if the user has set a command line flag. |
(...skipping 11 matching lines...) Expand all Loading... |
244 | 244 |
245 DCHECK(switch_value == switches::kPrerenderFromOmniboxSwitchValueAuto); | 245 DCHECK(switch_value == switches::kPrerenderFromOmniboxSwitchValueAuto); |
246 } | 246 } |
247 | 247 |
248 const int group = base::FieldTrialList::FindValue(kOmniboxTrialName); | 248 const int group = base::FieldTrialList::FindValue(kOmniboxTrialName); |
249 return group == base::FieldTrial::kNotFinalized || | 249 return group == base::FieldTrial::kNotFinalized || |
250 group == g_omnibox_trial_default_group_number; | 250 group == g_omnibox_trial_default_group_number; |
251 } | 251 } |
252 | 252 |
253 } // namespace prerender | 253 } // namespace prerender |
OLD | NEW |