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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 11741003: Remove PrefServiceSimple, replacing it with PrefService and PrefRegistrySimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix double registration in Chrome Frame test. Created 7 years, 10 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 | « chrome/browser/browser_shutdown.cc ('k') | chrome/browser/chromeos/audio/audio_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index b0e406b43079d2704a6e6764ede5adb24b7de681..e4939a0fd6541a247ab2398030f37fb443374ee3 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -76,6 +76,7 @@
#include "chrome/browser/policy/policy_service.h"
#include "chrome/browser/prefs/chrome_pref_service_factory.h"
#include "chrome/browser/prefs/command_line_pref_store.h"
+#include "chrome/browser/prefs/pref_registry_simple.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/prefs/pref_value_store.h"
#include "chrome/browser/prefs/scoped_user_pref_update.h"
@@ -251,27 +252,10 @@ PrefService* InitializeLocalState(
bool local_state_file_exists = file_util::PathExists(local_state_path);
// Load local state. This includes the application locale so we know which
- // locale dll to load.
- PrefServiceSimple* local_state = g_browser_process->local_state();
+ // locale dll to load. This also causes local state prefs to be registered.
+ PrefService* local_state = g_browser_process->local_state();
DCHECK(local_state);
- // TODO(brettw,*): this comment about ResourceBundle was here since
- // initial commit. This comment seems unrelated, bit-rotten and
- // a candidate for removal.
- // Initialize ResourceBundle which handles files loaded from external
- // sources. This has to be done before uninstall code path and before prefs
- // are registered.
- local_state->RegisterStringPref(prefs::kApplicationLocale, std::string());
-#if defined(OS_CHROMEOS)
- local_state->RegisterStringPref(prefs::kOwnerLocale, std::string());
- local_state->RegisterStringPref(prefs::kHardwareKeyboardLayout,
- std::string());
-#endif // defined(OS_CHROMEOS)
-#if !defined(OS_CHROMEOS)
- local_state->RegisterBooleanPref(prefs::kMetricsReportingEnabled,
- GoogleUpdateSettings::GetCollectStatsConsent());
-#endif // !defined(OS_CHROMEOS)
-
if (is_first_run) {
#if defined(OS_WIN)
// During first run we read the google_update registry key to find what
@@ -296,19 +280,23 @@ PrefService* InitializeLocalState(
// inherit and reset the user's setting.
//
// TODO(mnissler): We should probably just instantiate a
- // JSONPrefStore here instead of an entire PrefService.
+ // JSONPrefStore here instead of an entire PrefService. Once this is
+ // addressed, the call to browser_prefs::RegisterLocalState can move
+ // to chrome_prefs::CreateLocalState.
if (!local_state_file_exists &&
parsed_command_line.HasSwitch(switches::kParentProfile)) {
FilePath parent_profile =
parsed_command_line.GetSwitchValuePath(switches::kParentProfile);
- scoped_ptr<PrefServiceSimple> parent_local_state(
+ scoped_refptr<PrefRegistrySimple> registry = new PrefRegistrySimple();
+ scoped_ptr<PrefService> parent_local_state(
chrome_prefs::CreateLocalState(
parent_profile,
local_state_task_runner,
g_browser_process->policy_service(),
- NULL, false));
- parent_local_state->RegisterStringPref(prefs::kApplicationLocale,
- std::string());
+ NULL,
+ registry,
+ false));
+ registry->RegisterStringPref(prefs::kApplicationLocale, std::string());
// Right now, we only inherit the locale setting from the parent profile.
local_state->SetString(
prefs::kApplicationLocale,
« no previous file with comments | « chrome/browser/browser_shutdown.cc ('k') | chrome/browser/chromeos/audio/audio_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698