diff options
author | bbudge@google.com <bbudge@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-21 23:14:16 +0000 |
---|---|---|
committer | bbudge@google.com <bbudge@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-21 23:14:16 +0000 |
commit | 66c3cb0e9f8f58dbd258e6d31ba8bac5127b55f0 (patch) | |
tree | 152e32852a13f1903590918bd5cd68af92b51b4a /chrome | |
parent | bda50cd99291986fc13befc0aa8a62d247dceef7 (diff) | |
download | chromium_src-66c3cb0e9f8f58dbd258e6d31ba8bac5127b55f0.zip chromium_src-66c3cb0e9f8f58dbd258e6d31ba8bac5127b55f0.tar.gz chromium_src-66c3cb0e9f8f58dbd258e6d31ba8bac5127b55f0.tar.bz2 |
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
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser_main.cc | 6 | ||||
-rw-r--r-- | chrome/browser/dom_ui/flags_ui.cc | 9 | ||||
-rw-r--r-- | chrome/browser/dom_ui/flags_ui.h | 2 | ||||
-rw-r--r-- | chrome/browser/prefs/browser_prefs.cc | 2 | ||||
-rw-r--r-- | chrome/browser/profiles/profile_impl.cc | 4 |
5 files changed, 11 insertions, 12 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index ed8764c..a6866ea 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -1244,6 +1244,10 @@ 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. @@ -1579,7 +1583,7 @@ int BrowserMain(const MainFunctionParams& parameters) { HandleTestParameters(parsed_command_line); 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 // 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 bd70d028..ac76a8f 100644 --- a/chrome/browser/dom_ui/flags_ui.cc +++ b/chrome/browser/dom_ui/flags_ui.cc @@ -15,7 +15,6 @@ #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" @@ -136,7 +135,7 @@ void FlagsDOMHandler::HandleRequestFlagsExperiments(const ListValue* args) { DictionaryValue results; results.Set("flagsExperiments", about_flags::GetFlagsExperimentsData( - dom_ui_->GetProfile()->GetPrefs())); + g_browser_process->local_state())); results.SetBoolean("needsRestart", about_flags::IsRestartNeededToCommitChanges()); dom_ui_->CallJavascriptFunction(L"returnFlagsExperiments", results); @@ -155,7 +154,7 @@ void FlagsDOMHandler::HandleEnableFlagsExperimentMessage( return; about_flags::SetExperimentEnabled( - dom_ui_->GetProfile()->GetPrefs(), + g_browser_process->local_state(), experiment_internal_name, enable_str == "true"); } @@ -195,6 +194,6 @@ RefCountedMemory* FlagsUI::GetFaviconResourceBytes() { } // static -void FlagsUI::RegisterUserPrefs(PrefService* prefs) { - prefs->RegisterListPref(prefs::kEnabledLabsExperiments); +void FlagsUI::RegisterPrefs(PrefService* local_state) { + local_state->RegisterListPref(prefs::kEnabledLabsExperiments); } diff --git a/chrome/browser/dom_ui/flags_ui.h b/chrome/browser/dom_ui/flags_ui.h index 831ffe4..c2072c3 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 RegisterUserPrefs(PrefService* prefs); + static void RegisterPrefs(PrefService* local_state); private: DISALLOW_COPY_AND_ASSIGN(FlagsUI); diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc index 4bbd995..8253246 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc @@ -86,6 +86,7 @@ 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); @@ -128,7 +129,6 @@ 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 3b540d1..1204af0 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -13,7 +13,6 @@ #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" @@ -278,9 +277,6 @@ 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. |