summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profiles
diff options
context:
space:
mode:
authormnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-09 15:10:17 +0000
committermnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-09 15:10:17 +0000
commitf2d1f61006eac0f8a051fa485b2cffb6b6fa74e0 (patch)
treef848fcb564eaff40eeebcf7044da9972f798bd2b /chrome/browser/profiles
parentba99ca24c0ba8f0e154dbd74d8a43a55736630e1 (diff)
downloadchromium_src-f2d1f61006eac0f8a051fa485b2cffb6b6fa74e0.zip
chromium_src-f2d1f61006eac0f8a051fa485b2cffb6b6fa74e0.tar.gz
chromium_src-f2d1f61006eac0f8a051fa485b2cffb6b6fa74e0.tar.bz2
Sanitize PrefStore interface.
This reworks the PrefStore interface, specifically: - Split up the interface into PrefStore, which only provides reading functionality, and the derived PersistentPrefStore for the actual user pref store - Remove the hurt-me-plenty prefs() function from PrefStore, instead provide Get/Set/Remove operations - Remove special handling of default and user pref store from PrefValueStore and put it into PrefService - Pref change notification handling now almost exclusively handled through PrefValueStore - Adjust all consumers of these interfaces (but keep ConfigurationPolicyPrefStore untouched, that's up next on the list) BUG=64232 TEST=existing unit tests Review URL: http://codereview.chromium.org/5646003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68736 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profiles')
-rw-r--r--chrome/browser/profiles/profile_impl.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 7913da1..20c8166 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -35,6 +35,7 @@
#include "chrome/browser/extensions/extension_info_map.h"
#include "chrome/browser/extensions/extension_event_router.h"
#include "chrome/browser/extensions/extension_message_service.h"
+#include "chrome/browser/extensions/extension_pref_store.h"
#include "chrome/browser/extensions/extension_process_manager.h"
#include "chrome/browser/extensions/extensions_service.h"
#include "chrome/browser/extensions/user_script_master.h"
@@ -277,12 +278,6 @@ ProfileImpl::ProfileImpl(const FilePath& path)
pref_change_registrar_.Add(prefs::kEnableAutoSpellCorrect, this);
pref_change_registrar_.Add(prefs::kClearSiteDataOnExit, this);
- // Ensure that preferences set by extensions are restored in the profile
- // as early as possible. The constructor takes care of that.
- extension_prefs_.reset(new ExtensionPrefs(
- GetPrefs(),
- GetPath().AppendASCII(ExtensionsService::kInstallDirectoryName)));
-
// Convert active labs into switches. Modifies the current command line.
about_flags::ConvertFlagsToSwitches(prefs, CommandLine::ForCurrentProcess());
@@ -671,7 +666,9 @@ net::TransportSecurityState*
PrefService* ProfileImpl::GetPrefs() {
if (!prefs_.get()) {
+ ExtensionPrefStore* extension_pref_store = new ExtensionPrefStore;
prefs_.reset(PrefService::CreatePrefService(GetPrefFilePath(),
+ extension_pref_store,
GetOriginalProfile()));
// The Profile class and ProfileManager class may read some prefs so
@@ -688,6 +685,13 @@ PrefService* ProfileImpl::GetPrefs() {
// Make sure we save to disk that the session has opened.
prefs_->ScheduleSavePersistentPrefs();
+ // Ensure that preferences set by extensions are restored in the profile
+ // as early as possible. The constructor takes care of that.
+ extension_prefs_.reset(new ExtensionPrefs(
+ prefs_.get(),
+ GetPath().AppendASCII(ExtensionsService::kInstallDirectoryName),
+ extension_pref_store));
+
DCHECK(!net_pref_observer_.get());
net_pref_observer_.reset(new NetPrefObserver(prefs_.get()));
}