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

Unified Diff: chrome/browser/profiles/profile_impl.cc

Issue 5646003: Sanitize PrefStore interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix PrefService mock construction in PrefServiceTest to include command line store. Created 10 years 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
Index: chrome/browser/profiles/profile_impl.cc
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 7913da19f7dfc92f7e79be86df78b6c48cf28fe9..20c8166448dc43b229f33ef28d5538ed58372aa8 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()));
}
« no previous file with comments | « chrome/browser/prefs/value_map_pref_store.cc ('k') | chrome/browser/search_engines/keyword_editor_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698