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

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

Issue 8060017: Ensure that --disable-extensions disables extension prefs from being enacted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed mnissler's comments Created 9 years, 3 months 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 481b2ef05b6efca8ab25a49e676b5e1ed18c2cb6..db6002872264dbea0adfd80872efb48bc205b79f 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -932,12 +932,18 @@ void ProfileImpl::OnPrefsLoaded(bool success) {
// Make sure we save to disk that the session has opened.
prefs_->ScheduleSavePersistentPrefs();
+ bool extensions_disabled =
+ (prefs_->FindPreference(prefs::kDisableExtensions) &&
+ prefs_->GetBoolean(prefs::kDisableExtensions)) ||
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableExtensions);
Mattias Nissler (ping if slow) 2011/09/29 12:20:07 Hm, maybe handle the switch in CommandLinePrefStor
battre 2011/09/29 14:50:18 I looked into this and decided against it: It woul
+
// 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(ExtensionService::kInstallDirectoryName),
- GetExtensionPrefValueMap()));
+ GetExtensionPrefValueMap(),
+ extensions_disabled));
ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false);

Powered by Google App Engine
This is Rietveld 408576698