| 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" |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 } | 211 } |
| 212 scoped_refptr<FieldTrial> omnibox_prerender_trial( | 212 scoped_refptr<FieldTrial> omnibox_prerender_trial( |
| 213 FieldTrialList::FactoryGetFieldTrial( | 213 FieldTrialList::FactoryGetFieldTrial( |
| 214 kOmniboxTrialName, kDivisor, "OmniboxPrerenderEnabled", | 214 kOmniboxTrialName, kDivisor, "OmniboxPrerenderEnabled", |
| 215 2012, 12, 30, &g_omnibox_trial_default_group_number)); | 215 2012, 12, 30, &g_omnibox_trial_default_group_number)); |
| 216 omnibox_prerender_trial->AppendGroup("OmniboxPrerenderDisabled", | 216 omnibox_prerender_trial->AppendGroup("OmniboxPrerenderDisabled", |
| 217 kDisabledProbability); | 217 kDisabledProbability); |
| 218 } | 218 } |
| 219 | 219 |
| 220 bool IsOmniboxEnabled(Profile* profile) { | 220 bool IsOmniboxEnabled(Profile* profile) { |
| 221 return false; |
| 222 |
| 221 if (!profile) | 223 if (!profile) |
| 222 return false; | 224 return false; |
| 223 | 225 |
| 224 if (!PrerenderManager::IsPrerenderingPossible()) | 226 if (!PrerenderManager::IsPrerenderingPossible()) |
| 225 return false; | 227 return false; |
| 226 | 228 |
| 227 // Override any field trial groups if the user has set a command line flag. | 229 // Override any field trial groups if the user has set a command line flag. |
| 228 if (CommandLine::ForCurrentProcess()->HasSwitch( | 230 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 229 switches::kPrerenderFromOmnibox)) { | 231 switches::kPrerenderFromOmnibox)) { |
| 230 const std::string switch_value = | 232 const std::string switch_value = |
| (...skipping 13 matching lines...) Expand all Loading... |
| 244 return group == FieldTrial::kNotFinalized || | 246 return group == FieldTrial::kNotFinalized || |
| 245 group == g_omnibox_trial_default_group_number; | 247 group == g_omnibox_trial_default_group_number; |
| 246 } | 248 } |
| 247 | 249 |
| 248 bool IsLocalPredictorEnabled() { | 250 bool IsLocalPredictorEnabled() { |
| 249 return base::FieldTrialList::FindFullName(kLocalPredictorTrialName) == | 251 return base::FieldTrialList::FindFullName(kLocalPredictorTrialName) == |
| 250 kLocalPredictorEnabledGroup; | 252 kLocalPredictorEnabledGroup; |
| 251 } | 253 } |
| 252 | 254 |
| 253 } // namespace prerender | 255 } // namespace prerender |
| OLD | NEW |