Chromium Code Reviews| Index: chrome/browser/profiles/profile_manager.cc |
| diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc |
| index 9e25b1da6fc2a62e0f0631b42bdd39c25148c619..f65faf080450e1b593b4d02b0f5c886cfb00c5dd 100644 |
| --- a/chrome/browser/profiles/profile_manager.cc |
| +++ b/chrome/browser/profiles/profile_manager.cc |
| @@ -25,6 +25,7 @@ |
| #include "chrome/browser/content_settings/host_content_settings_map.h" |
| #include "chrome/browser/download/download_service.h" |
| #include "chrome/browser/download/download_service_factory.h" |
| +#include "chrome/browser/extensions/extension_service.h" |
| #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" |
| #include "chrome/browser/profiles/profile_avatar_icon_util.h" |
| @@ -1097,6 +1098,21 @@ void ProfileManager::FinishDeletingProfile(const base::FilePath& profile_dir) { |
| ProfileSyncServiceFactory::GetInstance()->GetForProfile( |
| profile)->DisableForUser(); |
| } |
| + |
| + // Disable apps & extensions now to stop them from running after a profile |
|
not at google - send to devlin
2014/05/06 22:25:29
I have a weak preference for this logic to be some
scheib
2014/05/07 21:29:35
Done.
|
| + // has been conceptually deleted. Don't wait for full browser shutdown and |
| + // the actual profile objects to be destroyed. |
| + ExtensionIdSet ids_to_unload = extensions::ExtensionRegistry::Get(profile) |
| + ->enabled_extensions() |
| + .GetIDs(); |
| + for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
| + it != ids_to_unload.end(); |
| + ++it) { |
| + extensions::ExtensionSystem::Get(profile) |
| + ->extension_service() |
| + ->UnloadExtension( |
| + *it, extensions::UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
| + } |
| } |
| QueueProfileDirectoryForDeletion(profile_dir); |