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

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

Issue 10824020: Move PROFILE_DESTROYED notification to ProfileDestroyer and observe it in ExtensionProcessManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: destroy original profile->destroy incognito EPM Created 8 years, 5 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
Index: chrome/browser/profiles/profile.cc
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc
index 79e99bf7084cbaaafdb07f8437fcfed9ed7f78f7..69d59adba5e5e83913801427f54649fd9260a94c 100644
--- a/chrome/browser/profiles/profile.cc
+++ b/chrome/browser/profiles/profile.cc
@@ -10,7 +10,10 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/sync_prefs.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
+#include "content/public/browser/notification_service.h"
+#include "content/public/browser/notification_source.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
@@ -21,6 +24,7 @@
Profile::Profile()
: restored_last_session_(false),
+ sent_destroyed_notification_(false),
accessibility_pause_level_(0) {
}
@@ -117,3 +121,13 @@ bool Profile::IsSyncAccessible() {
browser_sync::SyncPrefs prefs(GetPrefs());
return ProfileSyncService::IsSyncEnabled() && !prefs.IsManaged();
}
+
+void Profile::MaybeSendDestroyedNotification() {
+ if (!sent_destroyed_notification_) {
+ sent_destroyed_notification_ = true;
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_PROFILE_DESTROYED,
+ content::Source<Profile>(this),
+ content::NotificationService::NoDetails());
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698