| Index: chrome/browser/profile_impl.cc
|
| diff --git a/chrome/browser/profile_impl.cc b/chrome/browser/profile_impl.cc
|
| index 6e19ef48d2765446c168787a0361cb9108ab8f5b..cb2dce05aa6a457e5062d6b8b73d6f13abdab506 100644
|
| --- a/chrome/browser/profile_impl.cc
|
| +++ b/chrome/browser/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"
|
| @@ -261,7 +262,8 @@ ProfileImpl::ProfileImpl(const FilePath& path)
|
| #if defined(OS_WIN)
|
| checked_instant_promo_(false),
|
| #endif
|
| - shutdown_session_service_(false) {
|
| + shutdown_session_service_(false),
|
| + extension_prefs_(NULL) {
|
| DCHECK(!path.empty()) << "Using an empty path will attempt to write " <<
|
| "profile files to the root directory!";
|
| create_session_service_timer_.Start(
|
| @@ -275,6 +277,13 @@ 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(
|
| + this,
|
| + GetPrefs(),
|
| + GetPath().AppendASCII(ExtensionsService::kInstallDirectoryName)));
|
| +
|
| // Convert active labs into switches. Modifies the current command line.
|
| about_flags::ConvertFlagsToSwitches(prefs, CommandLine::ForCurrentProcess());
|
|
|
| @@ -353,6 +362,7 @@ void ProfileImpl::InitExtensions() {
|
| this,
|
| CommandLine::ForCurrentProcess(),
|
| GetPath().AppendASCII(ExtensionsService::kInstallDirectoryName),
|
| + extension_prefs_.get(),
|
| true);
|
|
|
| RegisterComponentExtensions();
|
| @@ -686,6 +696,14 @@ PrefService* ProfileImpl::GetPrefs() {
|
| return prefs_.get();
|
| }
|
|
|
| +PrefStore* ProfileImpl::GetExtensionPrefStore() {
|
| + return ext_pref_store_;
|
| +}
|
| +
|
| +void ProfileImpl::SetExtensionPrefStore(PrefStore* ext_pref_store) {
|
| + ext_pref_store_ = ext_pref_store;
|
| +}
|
| +
|
| FilePath ProfileImpl::GetPrefFilePath() {
|
| FilePath pref_file_path = path_;
|
| pref_file_path = pref_file_path.Append(chrome::kPreferencesFilename);
|
|
|