Chromium Code Reviews| 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 if (!profile->IsGuestSession() && | |
| 1008 cache.ProfileIsSigninRequiredAtIndex( | |
|
noms (inactive)
2014/11/13 15:24:54
nit: can cache.Profile...( go on the previous line
Mike Lerman
2014/11/13 15:30:05
Done.
| |
| 1009 cache.GetIndexOfProfileWithPath(profile->GetPath()))) { | |
| 1010 extensions::ExtensionSystem::Get(profile)->extension_service()-> | |
| 1011 BlockAllExtensions(); | |
| 1012 } | |
| 1013 | |
| 1004 #endif | 1014 #endif |
| 1005 #if defined(ENABLE_MANAGED_USERS) && !defined(OS_ANDROID) | 1015 #if defined(ENABLE_MANAGED_USERS) && !defined(OS_ANDROID) |
| 1006 // Initialization needs to happen after extension system initialization (for | 1016 // Initialization needs to happen after extension system initialization (for |
| 1007 // extension::ManagementPolicy) and InitProfileUserPrefs (for setting the | 1017 // extension::ManagementPolicy) and InitProfileUserPrefs (for setting the |
| 1008 // initializing the supervised flag if necessary). | 1018 // initializing the supervised flag if necessary). |
| 1009 SupervisedUserServiceFactory::GetForProfile(profile)->Init(); | 1019 SupervisedUserServiceFactory::GetForProfile(profile)->Init(); |
| 1010 #endif | 1020 #endif |
| 1011 // Start the deferred task runners once the profile is loaded. | 1021 // Start the deferred task runners once the profile is loaded. |
| 1012 StartupTaskRunnerServiceFactory::GetForProfile(profile)-> | 1022 StartupTaskRunnerServiceFactory::GetForProfile(profile)-> |
| 1013 StartDeferredTaskRunners(); | 1023 StartDeferredTaskRunners(); |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1329 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); | 1339 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); |
| 1330 FinishDeletingProfile(profile_to_delete_path); | 1340 FinishDeletingProfile(profile_to_delete_path); |
| 1331 } | 1341 } |
| 1332 } | 1342 } |
| 1333 } | 1343 } |
| 1334 #endif | 1344 #endif |
| 1335 | 1345 |
| 1336 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1346 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
| 1337 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1347 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
| 1338 } | 1348 } |
| OLD | NEW |