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

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

Issue 266343002: Unload all apps / extensions when deleting a profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
« no previous file with comments | « chrome/browser/background/background_contents_service.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « chrome/browser/background/background_contents_service.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698