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

Unified Diff: chrome/browser/prefs/pref_member.h

Issue 6773006: Add enableReferrers and enableHyperlinkAuditing to contentSettings.misc API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git try Created 9 years, 9 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/prefs/pref_member.h
diff --git a/chrome/browser/prefs/pref_member.h b/chrome/browser/prefs/pref_member.h
index 88a00711f4e91286a64d7f6130191160c873d0e8..28b6508af1a0c30d9d76f9d35f6ac0ef8877a432 100644
--- a/chrome/browser/prefs/pref_member.h
+++ b/chrome/browser/prefs/pref_member.h
@@ -33,8 +33,10 @@
#include "base/values.h"
#include "content/browser/browser_thread.h"
#include "content/common/notification_observer.h"
+#include "content/common/notification_registrar.h"
class PrefService;
+class Profile;
namespace subtle {
@@ -86,6 +88,8 @@ class PrefMemberBase : public NotificationObserver {
virtual void CreateInternal() const = 0;
+ void ObserveProfileDestruction(Profile* profile);
+
// See PrefMember<> for description.
void Destroy();
@@ -120,6 +124,7 @@ class PrefMemberBase : public NotificationObserver {
// Ordered the members to compact the class instance.
private:
std::string pref_name_;
+ NotificationRegistrar registrar_;
NotificationObserver* observer_;
PrefService* prefs_;
@@ -145,6 +150,12 @@ class PrefMember : public subtle::PrefMemberBase {
subtle::PrefMemberBase::Init(pref_name, prefs, observer);
}
+ // Starts observing PROFILE_DESTROYED notifications for the given |profile|,
+ // to automatically unsubscribe from the PrefService.
+ void ObserveProfileDestruction(Profile* profile) {
+ subtle::PrefMemberBase::ObserveProfileDestruction(profile);
+ }
+
// Unsubscribes the PrefMember from the PrefService. After calling this
// function, the PrefMember may not be used any more.
// This method should only be called on the UI thread.

Powered by Google App Engine
This is Rietveld 408576698