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

Unified Diff: chrome/browser/instant/instant_field_trial.cc

Issue 8198027: Allow controlling the Instant field trial through a command line flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/metrics/metrics_service_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/instant/instant_field_trial.cc
diff --git a/chrome/browser/instant/instant_field_trial.cc b/chrome/browser/instant/instant_field_trial.cc
index dc68ac9e77f53c56302577aa9943d3b025898852..13a0b4284ddb09ae203e63c547279acc9a104194 100644
--- a/chrome/browser/instant/instant_field_trial.cc
+++ b/chrome/browser/instant/instant_field_trial.cc
@@ -4,10 +4,12 @@
#include "chrome/browser/instant/instant_field_trial.h"
+#include "base/command_line.h"
#include "base/metrics/field_trial.h"
#include "chrome/browser/metrics/metrics_service.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
namespace {
@@ -39,6 +41,16 @@ void InstantFieldTrial::Activate() {
// static
InstantFieldTrial::Group InstantFieldTrial::GetGroup(Profile* profile) {
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kInstantFieldTrial)) {
+ std::string switch_value =
+ command_line->GetSwitchValueASCII(switches::kInstantFieldTrial);
+ if (switch_value == switches::kInstantFieldTrialInstant)
+ return EXPERIMENT1;
+ else
+ return INACTIVE;
+ }
+
if (!profile || profile->IsOffTheRecord())
return INACTIVE;
« no previous file with comments | « no previous file | chrome/browser/metrics/metrics_service_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698