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

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

Issue 695133005: Temporarily disable extensions and sync while a profile is locked - Profiles Approach (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 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/profiles/profile_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 1eceba98853543353e672a8d1e1245fdb9160bc2..2def7686de60bb8d2efaf603b384f811fc75f5d8 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -993,6 +993,7 @@ void ProfileManager::DoFinalInit(Profile* profile, bool go_off_the_record) {
void ProfileManager::DoFinalInitForServices(Profile* profile,
bool go_off_the_record) {
#if defined(ENABLE_EXTENSIONS)
+ ProfileInfoCache& cache = GetProfileInfoCache();
extensions::ExtensionSystem::Get(profile)->InitForRegularProfile(
!go_off_the_record);
// During tests, when |profile| is an instance of TestingProfile,
@@ -1001,6 +1002,16 @@ void ProfileManager::DoFinalInitForServices(Profile* profile,
extensions::ExtensionSystem::Get(profile)->extension_service()->
RegisterContentSettings(profile->GetHostContentSettingsMap());
}
+ // Set the block extensions bit on the ExtensionService. There likely are no
+ // blockable extensions to block.
+ size_t profile_index = cache.GetIndexOfProfileWithPath(profile->GetPath());
+ if (profile_index != std::string::npos &&
+ cache.ProfileIsSigninRequiredAtIndex(profile_index)) {
+ extensions::ExtensionSystem::Get(profile)
+ ->extension_service()
+ ->BlockAllExtensions();
+ }
+
#endif
#if defined(ENABLE_MANAGED_USERS) && !defined(OS_ANDROID)
// Initialization needs to happen after extension system initialization (for

Powered by Google App Engine
This is Rietveld 408576698