| Index: chrome/browser/chrome_browser_main.cc
|
| diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
|
| index 558380fd94ea63cc4d32ca309eebc794800e5b1a..458769fde18691183d71e11b3cc2e0ff7830a4aa 100644
|
| --- a/chrome/browser/chrome_browser_main.cc
|
| +++ b/chrome/browser/chrome_browser_main.cc
|
| @@ -69,6 +69,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"
|
| @@ -231,27 +232,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
|
| @@ -281,14 +265,16 @@ PrefService* InitializeLocalState(
|
| parsed_command_line.HasSwitch(switches::kParentProfile)) {
|
| FilePath parent_profile =
|
| parsed_command_line.GetSwitchValuePath(switches::kParentProfile);
|
| - scoped_ptr<PrefServiceSimple> parent_local_state(
|
| + 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,
|
| + scoped_ptr<PrefRegistry>(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,
|
|
|