summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrniwa@chromium.org <rniwa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-22 05:53:59 +0000
committerrniwa@chromium.org <rniwa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-22 05:53:59 +0000
commitc7605a7b7f7eb416f436a57d6666bcc2af024774 (patch)
treee8b5de0591d8a4e26778278427538a4056e27976
parentb8dc182ba5a4724861bd11465fb633969e4429b5 (diff)
downloadchromium_src-c7605a7b7f7eb416f436a57d6666bcc2af024774.zip
chromium_src-c7605a7b7f7eb416f436a57d6666bcc2af024774.tar.gz
chromium_src-c7605a7b7f7eb416f436a57d6666bcc2af024774.tar.bz2
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
-rw-r--r--chrome/browser/browser_main.cc6
-rw-r--r--chrome/browser/dom_ui/flags_ui.cc9
-rw-r--r--chrome/browser/dom_ui/flags_ui.h2
-rw-r--r--chrome/browser/prefs/browser_prefs.cc2
-rw-r--r--chrome/browser/profiles/profile_impl.cc4
5 files changed, 12 insertions, 11 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index dc2b84a..38e9d33 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -1244,10 +1244,6 @@ int BrowserMain(const MainFunctionParams& parameters) {
// Initialize the prefs of the 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
// 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.
@@ -1583,7 +1579,7 @@ int BrowserMain(const MainFunctionParams& parameters) {
HandleTestParameters(parsed_command_line);
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
// should display the entry in the context menu or not.
diff --git a/chrome/browser/dom_ui/flags_ui.cc b/chrome/browser/dom_ui/flags_ui.cc
index 636cb76..c301463 100644
--- a/chrome/browser/dom_ui/flags_ui.cc
+++ b/chrome/browser/dom_ui/flags_ui.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/dom_ui/chrome_url_data_manager.h"
#include "chrome/browser/prefs/pref_service.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/common/jstemplate_builder.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
@@ -135,7 +136,7 @@ void FlagsDOMHandler::HandleRequestFlagsExperiments(const ListValue* args) {
DictionaryValue results;
results.Set("flagsExperiments",
about_flags::GetFlagsExperimentsData(
- g_browser_process->local_state()));
+ dom_ui_->GetProfile()->GetPrefs()));
results.SetBoolean("needsRestart",
about_flags::IsRestartNeededToCommitChanges());
dom_ui_->CallJavascriptFunction(L"returnFlagsExperiments", results);
@@ -154,7 +155,7 @@ void FlagsDOMHandler::HandleEnableFlagsExperimentMessage(
return;
about_flags::SetExperimentEnabled(
- g_browser_process->local_state(),
+ dom_ui_->GetProfile()->GetPrefs(),
experiment_internal_name,
enable_str == "true");
}
@@ -194,6 +195,6 @@ RefCountedMemory* FlagsUI::GetFaviconResourceBytes() {
}
// static
-void FlagsUI::RegisterPrefs(PrefService* local_state) {
- local_state->RegisterListPref(prefs::kEnabledLabsExperiments);
+void FlagsUI::RegisterUserPrefs(PrefService* prefs) {
+ prefs->RegisterListPref(prefs::kEnabledLabsExperiments);
}
diff --git a/chrome/browser/dom_ui/flags_ui.h b/chrome/browser/dom_ui/flags_ui.h
index c2072c3..831ffe4 100644
--- a/chrome/browser/dom_ui/flags_ui.h
+++ b/chrome/browser/dom_ui/flags_ui.h
@@ -16,7 +16,7 @@ class FlagsUI : public DOMUI {
explicit FlagsUI(TabContents* contents);
static RefCountedMemory* GetFaviconResourceBytes();
- static void RegisterPrefs(PrefService* local_state);
+ static void RegisterUserPrefs(PrefService* prefs);
private:
DISALLOW_COPY_AND_ASSIGN(FlagsUI);
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 8253246..4bbd995 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -86,7 +86,6 @@ void RegisterAllPrefs(PrefService* user_prefs, PrefService* local_state) {
void RegisterLocalState(PrefService* local_state) {
// Prefs in Local State
Browser::RegisterPrefs(local_state);
- FlagsUI::RegisterPrefs(local_state);
WebCacheManager::RegisterPrefs(local_state);
ExternalProtocolHandler::RegisterPrefs(local_state);
GoogleURLTracker::RegisterPrefs(local_state);
@@ -129,6 +128,7 @@ void RegisterUserPrefs(PrefService* user_prefs) {
TemplateURLPrepopulateData::RegisterUserPrefs(user_prefs);
ExtensionDOMUI::RegisterUserPrefs(user_prefs);
ExtensionsUI::RegisterUserPrefs(user_prefs);
+ FlagsUI::RegisterUserPrefs(user_prefs);
NewTabUI::RegisterUserPrefs(user_prefs);
PluginsUI::RegisterUserPrefs(user_prefs);
ProfileImpl::RegisterUserPrefs(user_prefs);
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 1204af0..3b540d1 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -13,6 +13,7 @@
#include "base/scoped_ptr.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
+#include "chrome/browser/about_flags.h"
#include "chrome/browser/appcache/chrome_appcache_service.h"
#include "chrome/browser/autocomplete/autocomplete_classifier.h"
#include "chrome/browser/autofill/personal_data_manager.h"
@@ -277,6 +278,9 @@ ProfileImpl::ProfileImpl(const FilePath& path)
pref_change_registrar_.Add(prefs::kEnableAutoSpellCorrect, 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
// the cache directory depends on the profile directory, which isn't available
// to PathService.