OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/profiles/profile_manager.h" | 5 #include "chrome/browser/profiles/profile_manager.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 ProfileMetrics::LogNumberOfProfiles(this); | 986 ProfileMetrics::LogNumberOfProfiles(this); |
987 content::NotificationService::current()->Notify( | 987 content::NotificationService::current()->Notify( |
988 chrome::NOTIFICATION_PROFILE_ADDED, | 988 chrome::NOTIFICATION_PROFILE_ADDED, |
989 content::Source<Profile>(profile), | 989 content::Source<Profile>(profile), |
990 content::NotificationService::NoDetails()); | 990 content::NotificationService::NoDetails()); |
991 } | 991 } |
992 | 992 |
993 void ProfileManager::DoFinalInitForServices(Profile* profile, | 993 void ProfileManager::DoFinalInitForServices(Profile* profile, |
994 bool go_off_the_record) { | 994 bool go_off_the_record) { |
995 #if defined(ENABLE_EXTENSIONS) | 995 #if defined(ENABLE_EXTENSIONS) |
| 996 ProfileInfoCache& cache = GetProfileInfoCache(); |
996 extensions::ExtensionSystem::Get(profile)->InitForRegularProfile( | 997 extensions::ExtensionSystem::Get(profile)->InitForRegularProfile( |
997 !go_off_the_record); | 998 !go_off_the_record); |
998 // During tests, when |profile| is an instance of TestingProfile, | 999 // During tests, when |profile| is an instance of TestingProfile, |
999 // ExtensionSystem might not create an ExtensionService. | 1000 // ExtensionSystem might not create an ExtensionService. |
1000 if (extensions::ExtensionSystem::Get(profile)->extension_service()) { | 1001 if (extensions::ExtensionSystem::Get(profile)->extension_service()) { |
1001 extensions::ExtensionSystem::Get(profile)->extension_service()-> | 1002 extensions::ExtensionSystem::Get(profile)->extension_service()-> |
1002 RegisterContentSettings(profile->GetHostContentSettingsMap()); | 1003 RegisterContentSettings(profile->GetHostContentSettingsMap()); |
1003 } | 1004 } |
| 1005 // Set the block extensions bit on the ExtensionService. There likely are no |
| 1006 // blockable extensions to block. |
| 1007 size_t profile_index = cache.GetIndexOfProfileWithPath(profile->GetPath()); |
| 1008 if (profile_index != std::string::npos && |
| 1009 cache.ProfileIsSigninRequiredAtIndex(profile_index)) { |
| 1010 extensions::ExtensionSystem::Get(profile) |
| 1011 ->extension_service() |
| 1012 ->BlockAllExtensions(); |
| 1013 } |
| 1014 |
1004 #endif | 1015 #endif |
1005 #if defined(ENABLE_MANAGED_USERS) && !defined(OS_ANDROID) | 1016 #if defined(ENABLE_MANAGED_USERS) && !defined(OS_ANDROID) |
1006 // Initialization needs to happen after extension system initialization (for | 1017 // Initialization needs to happen after extension system initialization (for |
1007 // extension::ManagementPolicy) and InitProfileUserPrefs (for setting the | 1018 // extension::ManagementPolicy) and InitProfileUserPrefs (for setting the |
1008 // initializing the supervised flag if necessary). | 1019 // initializing the supervised flag if necessary). |
1009 SupervisedUserServiceFactory::GetForProfile(profile)->Init(); | 1020 SupervisedUserServiceFactory::GetForProfile(profile)->Init(); |
1010 #endif | 1021 #endif |
1011 // Start the deferred task runners once the profile is loaded. | 1022 // Start the deferred task runners once the profile is loaded. |
1012 StartupTaskRunnerServiceFactory::GetForProfile(profile)-> | 1023 StartupTaskRunnerServiceFactory::GetForProfile(profile)-> |
1013 StartDeferredTaskRunners(); | 1024 StartDeferredTaskRunners(); |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1329 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); | 1340 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); |
1330 FinishDeletingProfile(profile_to_delete_path); | 1341 FinishDeletingProfile(profile_to_delete_path); |
1331 } | 1342 } |
1332 } | 1343 } |
1333 } | 1344 } |
1334 #endif | 1345 #endif |
1335 | 1346 |
1336 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1347 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
1337 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1348 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
1338 } | 1349 } |
OLD | NEW |