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

Side by Side Diff: chrome/browser/prerender/prerender_field_trial.cc

Issue 12387108: temporarily disable omnibox prerendering for m25 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 9 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
« no previous file with comments | « chrome/browser/predictors/autocomplete_action_predictor_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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 2013, 12, 31, &g_omnibox_trial_default_group_number)); 215 2013, 12, 31, &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
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
OLDNEW
« no previous file with comments | « chrome/browser/predictors/autocomplete_action_predictor_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698