Commit 66c3cb0e authored by bbudge@google.com's avatar bbudge@google.com

This patch moves the experiments settings from the user profile to the...

This patch moves the experiments settings from the user profile to the browser's local state, since these settings correspond to command line switches.
This is a release blocker for NaCl, so we decided to push this through.

TEST=manual
BUG= http://code.google.com/p/nativeclient/issues/detail?id=1322
Review URL: http://codereview.chromium.org/6267009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72225 0039d316-1c4b-4281-b951-d872f2087c98
parent bda50cd9
...@@ -1244,6 +1244,10 @@ int BrowserMain(const MainFunctionParams& parameters) { ...@@ -1244,6 +1244,10 @@ int BrowserMain(const MainFunctionParams& parameters) {
// Initialize the prefs of the local state. // Initialize the prefs of the local state.
browser::RegisterLocalState(local_state); browser::RegisterLocalState(local_state);
// Convert active labs into switches. Modifies the current command line.
about_flags::ConvertFlagsToSwitches(local_state,
CommandLine::ForCurrentProcess());
// Now that all preferences have been registered, set the install date // Now that all preferences have been registered, set the install date
// for the uninstall metrics if this is our first run. This only actually // for the uninstall metrics if this is our first run. This only actually
// gets used if the user has metrics reporting enabled at uninstall time. // gets used if the user has metrics reporting enabled at uninstall time.
...@@ -1579,7 +1583,7 @@ int BrowserMain(const MainFunctionParams& parameters) { ...@@ -1579,7 +1583,7 @@ int BrowserMain(const MainFunctionParams& parameters) {
HandleTestParameters(parsed_command_line); HandleTestParameters(parsed_command_line);
RecordBreakpadStatusUMA(metrics); RecordBreakpadStatusUMA(metrics);
about_flags::RecordUMAStatistics(user_prefs); about_flags::RecordUMAStatistics(local_state);
// Stat the directory with the inspector's files so that we can know if we // Stat the directory with the inspector's files so that we can know if we
// should display the entry in the context menu or not. // should display the entry in the context menu or not.
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "chrome/browser/browser_thread.h" #include "chrome/browser/browser_thread.h"
#include "chrome/browser/dom_ui/chrome_url_data_manager.h" #include "chrome/browser/dom_ui/chrome_url_data_manager.h"
#include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/jstemplate_builder.h" #include "chrome/common/jstemplate_builder.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h" #include "chrome/common/url_constants.h"
...@@ -136,7 +135,7 @@ void FlagsDOMHandler::HandleRequestFlagsExperiments(const ListValue* args) { ...@@ -136,7 +135,7 @@ void FlagsDOMHandler::HandleRequestFlagsExperiments(const ListValue* args) {
DictionaryValue results; DictionaryValue results;
results.Set("flagsExperiments", results.Set("flagsExperiments",
about_flags::GetFlagsExperimentsData( about_flags::GetFlagsExperimentsData(
dom_ui_->GetProfile()->GetPrefs())); g_browser_process->local_state()));
results.SetBoolean("needsRestart", results.SetBoolean("needsRestart",
about_flags::IsRestartNeededToCommitChanges()); about_flags::IsRestartNeededToCommitChanges());
dom_ui_->CallJavascriptFunction(L"returnFlagsExperiments", results); dom_ui_->CallJavascriptFunction(L"returnFlagsExperiments", results);
...@@ -155,7 +154,7 @@ void FlagsDOMHandler::HandleEnableFlagsExperimentMessage( ...@@ -155,7 +154,7 @@ void FlagsDOMHandler::HandleEnableFlagsExperimentMessage(
return; return;
about_flags::SetExperimentEnabled( about_flags::SetExperimentEnabled(
dom_ui_->GetProfile()->GetPrefs(), g_browser_process->local_state(),
experiment_internal_name, experiment_internal_name,
enable_str == "true"); enable_str == "true");
} }
...@@ -195,6 +194,6 @@ RefCountedMemory* FlagsUI::GetFaviconResourceBytes() { ...@@ -195,6 +194,6 @@ RefCountedMemory* FlagsUI::GetFaviconResourceBytes() {
} }
// static // static
void FlagsUI::RegisterUserPrefs(PrefService* prefs) { void FlagsUI::RegisterPrefs(PrefService* local_state) {
prefs->RegisterListPref(prefs::kEnabledLabsExperiments); local_state->RegisterListPref(prefs::kEnabledLabsExperiments);
} }
...@@ -16,7 +16,7 @@ class FlagsUI : public DOMUI { ...@@ -16,7 +16,7 @@ class FlagsUI : public DOMUI {
explicit FlagsUI(TabContents* contents); explicit FlagsUI(TabContents* contents);
static RefCountedMemory* GetFaviconResourceBytes(); static RefCountedMemory* GetFaviconResourceBytes();
static void RegisterUserPrefs(PrefService* prefs); static void RegisterPrefs(PrefService* local_state);
private: private:
DISALLOW_COPY_AND_ASSIGN(FlagsUI); DISALLOW_COPY_AND_ASSIGN(FlagsUI);
......
...@@ -86,6 +86,7 @@ void RegisterAllPrefs(PrefService* user_prefs, PrefService* local_state) { ...@@ -86,6 +86,7 @@ void RegisterAllPrefs(PrefService* user_prefs, PrefService* local_state) {
void RegisterLocalState(PrefService* local_state) { void RegisterLocalState(PrefService* local_state) {
// Prefs in Local State // Prefs in Local State
Browser::RegisterPrefs(local_state); Browser::RegisterPrefs(local_state);
FlagsUI::RegisterPrefs(local_state);
WebCacheManager::RegisterPrefs(local_state); WebCacheManager::RegisterPrefs(local_state);
ExternalProtocolHandler::RegisterPrefs(local_state); ExternalProtocolHandler::RegisterPrefs(local_state);
GoogleURLTracker::RegisterPrefs(local_state); GoogleURLTracker::RegisterPrefs(local_state);
...@@ -128,7 +129,6 @@ void RegisterUserPrefs(PrefService* user_prefs) { ...@@ -128,7 +129,6 @@ void RegisterUserPrefs(PrefService* user_prefs) {
TemplateURLPrepopulateData::RegisterUserPrefs(user_prefs); TemplateURLPrepopulateData::RegisterUserPrefs(user_prefs);
ExtensionDOMUI::RegisterUserPrefs(user_prefs); ExtensionDOMUI::RegisterUserPrefs(user_prefs);
ExtensionsUI::RegisterUserPrefs(user_prefs); ExtensionsUI::RegisterUserPrefs(user_prefs);
FlagsUI::RegisterUserPrefs(user_prefs);
NewTabUI::RegisterUserPrefs(user_prefs); NewTabUI::RegisterUserPrefs(user_prefs);
PluginsUI::RegisterUserPrefs(user_prefs); PluginsUI::RegisterUserPrefs(user_prefs);
ProfileImpl::RegisterUserPrefs(user_prefs); ProfileImpl::RegisterUserPrefs(user_prefs);
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "base/scoped_ptr.h" #include "base/scoped_ptr.h"
#include "base/string_number_conversions.h" #include "base/string_number_conversions.h"
#include "base/string_util.h" #include "base/string_util.h"
#include "chrome/browser/about_flags.h"
#include "chrome/browser/appcache/chrome_appcache_service.h" #include "chrome/browser/appcache/chrome_appcache_service.h"
#include "chrome/browser/autocomplete/autocomplete_classifier.h" #include "chrome/browser/autocomplete/autocomplete_classifier.h"
#include "chrome/browser/autofill/personal_data_manager.h" #include "chrome/browser/autofill/personal_data_manager.h"
...@@ -278,9 +277,6 @@ ProfileImpl::ProfileImpl(const FilePath& path) ...@@ -278,9 +277,6 @@ ProfileImpl::ProfileImpl(const FilePath& path)
pref_change_registrar_.Add(prefs::kEnableAutoSpellCorrect, this); pref_change_registrar_.Add(prefs::kEnableAutoSpellCorrect, this);
pref_change_registrar_.Add(prefs::kClearSiteDataOnExit, this); pref_change_registrar_.Add(prefs::kClearSiteDataOnExit, this);
// Convert active labs into switches. Modifies the current command line.
about_flags::ConvertFlagsToSwitches(prefs, CommandLine::ForCurrentProcess());
// It would be nice to use PathService for fetching this directory, but // It would be nice to use PathService for fetching this directory, but
// the cache directory depends on the profile directory, which isn't available // the cache directory depends on the profile directory, which isn't available
// to PathService. // to PathService.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment