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

Unified Diff: chrome/browser/profile_impl.cc

Issue 5213002: Fix for Bug 50726 "Save extension list and "winning" prefs from extensions" (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Temporary hack to fix regression in unit tests Created 10 years, 1 month 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/profile_impl.cc
diff --git a/chrome/browser/profile_impl.cc b/chrome/browser/profile_impl.cc
index 8b62962ee07cfb12dc35cca2d93259779650d27c..7c2c10f1965d7c7705f948343ba3090f632286b9 100644
--- a/chrome/browser/profile_impl.cc
+++ b/chrome/browser/profile_impl.cc
@@ -265,7 +265,8 @@ ProfileImpl::ProfileImpl(const FilePath& path)
#if defined(OS_WIN)
checked_instant_promo_(false),
#endif
- shutdown_session_service_(false) {
+ shutdown_session_service_(false),
+ tmp_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(
@@ -278,6 +279,12 @@ ProfileImpl::ProfileImpl(const FilePath& path)
pref_change_registrar_.Add(prefs::kEnableSpellCheck, this);
pref_change_registrar_.Add(prefs::kEnableAutoSpellCorrect, this);
+ // Ensure that preferences set by extensions are restored in the profile
+ // as early as possible. The constructor takes care of that.
+ tmp_extension_prefs_.reset(new ExtensionPrefs(
Aaron Boodman 2010/11/23 20:35:13 I think it is OK for profile to just own Extension
battre (please use the other) 2010/11/30 17:46:53 Done.
+ GetPrefs(),
+ GetPath().AppendASCII(ExtensionsService::kInstallDirectoryName)));
+
// Convert active labs into switches. Modifies the current command line.
about_flags::ConvertFlagsToSwitches(prefs, CommandLine::ForCurrentProcess());
@@ -387,6 +394,7 @@ void ProfileImpl::InitExtensions() {
this,
CommandLine::ForCurrentProcess(),
GetPath().AppendASCII(ExtensionsService::kInstallDirectoryName),
+ tmp_extension_prefs_.release(),
true);
RegisterComponentExtensions();

Powered by Google App Engine
This is Rietveld 408576698