Commit c7605a7b authored by rniwa@chromium.org's avatar rniwa@chromium.org

Revert 72225 - This patch moves the experiments settings from the user profile...

Revert 72225 - 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.

Windows browser tests are failing.

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

TBR=bbudge@google.com
Review URL: http://codereview.chromium.org/6262010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72271 0039d316-1c4b-4281-b951-d872f2087c98
parent b8dc182b
...@@ -1244,10 +1244,6 @@ int BrowserMain(const MainFunctionParams& parameters) { ...@@ -1244,10 +1244,6 @@ 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.
...@@ -1583,7 +1579,7 @@ int BrowserMain(const MainFunctionParams& parameters) { ...@@ -1583,7 +1579,7 @@ int BrowserMain(const MainFunctionParams& parameters) {
HandleTestParameters(parsed_command_line); HandleTestParameters(parsed_command_line);
RecordBreakpadStatusUMA(metrics); RecordBreakpadStatusUMA(metrics);
about_flags::RecordUMAStatistics(local_state); about_flags::RecordUMAStatistics(user_prefs);
// 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.
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#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"
...@@ -135,7 +136,7 @@ void FlagsDOMHandler::HandleRequestFlagsExperiments(const ListValue* args) { ...@@ -135,7 +136,7 @@ void FlagsDOMHandler::HandleRequestFlagsExperiments(const ListValue* args) {
DictionaryValue results; DictionaryValue results;
results.Set("flagsExperiments", results.Set("flagsExperiments",
about_flags::GetFlagsExperimentsData( about_flags::GetFlagsExperimentsData(
g_browser_process->local_state())); dom_ui_->GetProfile()->GetPrefs()));
results.SetBoolean("needsRestart", results.SetBoolean("needsRestart",
about_flags::IsRestartNeededToCommitChanges()); about_flags::IsRestartNeededToCommitChanges());
dom_ui_->CallJavascriptFunction(L"returnFlagsExperiments", results); dom_ui_->CallJavascriptFunction(L"returnFlagsExperiments", results);
...@@ -154,7 +155,7 @@ void FlagsDOMHandler::HandleEnableFlagsExperimentMessage( ...@@ -154,7 +155,7 @@ void FlagsDOMHandler::HandleEnableFlagsExperimentMessage(
return; return;
about_flags::SetExperimentEnabled( about_flags::SetExperimentEnabled(
g_browser_process->local_state(), dom_ui_->GetProfile()->GetPrefs(),
experiment_internal_name, experiment_internal_name,
enable_str == "true"); enable_str == "true");
} }
...@@ -194,6 +195,6 @@ RefCountedMemory* FlagsUI::GetFaviconResourceBytes() { ...@@ -194,6 +195,6 @@ RefCountedMemory* FlagsUI::GetFaviconResourceBytes() {
} }
// static // static
void FlagsUI::RegisterPrefs(PrefService* local_state) { void FlagsUI::RegisterUserPrefs(PrefService* prefs) {
local_state->RegisterListPref(prefs::kEnabledLabsExperiments); prefs->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 RegisterPrefs(PrefService* local_state); static void RegisterUserPrefs(PrefService* prefs);
private: private:
DISALLOW_COPY_AND_ASSIGN(FlagsUI); DISALLOW_COPY_AND_ASSIGN(FlagsUI);
......
...@@ -86,7 +86,6 @@ void RegisterAllPrefs(PrefService* user_prefs, PrefService* local_state) { ...@@ -86,7 +86,6 @@ 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);
...@@ -129,6 +128,7 @@ void RegisterUserPrefs(PrefService* user_prefs) { ...@@ -129,6 +128,7 @@ 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,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#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"
...@@ -277,6 +278,9 @@ ProfileImpl::ProfileImpl(const FilePath& path) ...@@ -277,6 +278,9 @@ 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