Chromium Code Reviews| Index: chrome/browser/content_settings/content_settings_pref_provider.h |
| diff --git a/chrome/browser/content_settings/content_settings_pref_provider.h b/chrome/browser/content_settings/content_settings_pref_provider.h |
| index f2909c7313282efc18fafca396fa42c5a7e181b8..22d6373963ee14a3b9169ba5738047c1a34b58b2 100644 |
| --- a/chrome/browser/content_settings/content_settings_pref_provider.h |
| +++ b/chrome/browser/content_settings/content_settings_pref_provider.h |
| @@ -23,8 +23,8 @@ |
| class ContentSettingsDetails; |
| class DictionaryValue; |
| +class HostContentSettingsMap; |
| class PrefService; |
| -class Profile; |
| namespace content_settings { |
| @@ -33,7 +33,9 @@ namespace content_settings { |
| class PrefDefaultProvider : public DefaultProviderInterface, |
| public NotificationObserver { |
| public: |
| - explicit PrefDefaultProvider(Profile* profile); |
| + explicit PrefDefaultProvider(HostContentSettingsMap* map, |
|
markusheintz_
2011/07/06 15:56:24
explicit not needed
|
| + PrefService* prefs, |
| + bool incognito); |
| virtual ~PrefDefaultProvider(); |
| // DefaultContentSettingsProvider implementation. |
| @@ -44,6 +46,8 @@ class PrefDefaultProvider : public DefaultProviderInterface, |
| virtual void ResetToDefaults(); |
| virtual bool DefaultSettingIsManaged(ContentSettingsType content_type) const; |
| + void ShutdownOnUIThread(); |
| + |
| static void RegisterUserPrefs(PrefService* prefs); |
| // NotificationObserver implementation. |
| @@ -58,8 +62,6 @@ class PrefDefaultProvider : public DefaultProviderInterface, |
| // mutex deadlock. |
| void NotifyObservers(const ContentSettingsDetails& details); |
| - void UnregisterObservers(); |
| - |
| // Sets the fields of |settings| based on the values in |dictionary|. |
| void GetSettingsFromDictionary(const DictionaryValue* dictionary, |
| ContentSettings* settings); |
| @@ -72,12 +74,13 @@ class PrefDefaultProvider : public DefaultProviderInterface, |
| // true and the preference is missing, the local copy will be cleared as well. |
| void ReadDefaultSettings(bool overwrite); |
| - void MigrateObsoleteNotificationPref(PrefService* prefs); |
| + void MigrateObsoleteNotificationPref(); |
| // Copies of the pref data, so that we can read it on the IO thread. |
| ContentSettings default_content_settings_; |
| - Profile* profile_; |
| + HostContentSettingsMap* map_; |
| + PrefService* prefs_; |
| // Whether this settings map is for an Incognito session. |
| bool is_incognito_; |
| @@ -87,14 +90,11 @@ class PrefDefaultProvider : public DefaultProviderInterface, |
| mutable base::Lock lock_; |
| PrefChangeRegistrar pref_change_registrar_; |
| - NotificationRegistrar notification_registrar_; |
| // Whether we are currently updating preferences, this is used to ignore |
| // notifications from the preferences service that we triggered ourself. |
| bool updating_preferences_; |
| - bool initializing_; |
| - |
| DISALLOW_COPY_AND_ASSIGN(PrefDefaultProvider); |
| }; |
| @@ -105,7 +105,9 @@ class PrefProvider : public ProviderInterface, |
| public: |
| static void RegisterUserPrefs(PrefService* prefs); |
| - explicit PrefProvider(Profile* profile); |
| + explicit PrefProvider(HostContentSettingsMap* map, |
|
markusheintz_
2011/07/06 15:56:24
pls remove the explicit
|
| + PrefService* prefs, |
| + bool incognito); |
| virtual ~PrefProvider(); |
| // ProviderInterface implementations. |
| @@ -132,6 +134,8 @@ class PrefProvider : public ProviderInterface, |
| virtual void ResetToDefaults(); |
| + virtual void ShutdownOnUIThread(); |
| + |
| // NotificationObserver implementation. |
| virtual void Observe(NotificationType type, |
| const NotificationSource& source, |
| @@ -175,37 +179,35 @@ class PrefProvider : public ProviderInterface, |
| // Various migration methods (old cookie, popup and per-host data gets |
| // migrated to the new format). |
| - void MigrateObsoletePerhostPref(PrefService* prefs); |
| - void MigrateObsoletePopupsPref(PrefService* prefs); |
| - void MigrateObsoleteContentSettingsPatternPref(PrefService* prefs); |
| + void MigrateObsoletePerhostPref(); |
| + void MigrateObsoletePopupsPref(); |
| + void MigrateObsoleteContentSettingsPatternPref(); |
| // Copies the value of the preference that stores the content settings |
| // exceptions to the obsolete preference for content settings exceptions. This |
| // is necessary to allow content settings exceptions beeing synced to older |
| // versions of chrome that only use the obsolete. |
| - void SyncObsoletePref(PrefService* pref); |
| + void SyncObsoletePref(); |
| void CanonicalizeContentSettingsExceptions( |
| DictionaryValue* all_settings_dictionary); |
| void NotifyObservers(const ContentSettingsDetails& details); |
| - void UnregisterObservers(); |
| + // Weak; owned by the Profile and reset in ShutdownOnUIThread. |
| + PrefService* prefs_; |
| - Profile* profile_; |
| + // Weak; owns us |
| + HostContentSettingsMap* map_; |
| bool is_incognito_; |
| PrefChangeRegistrar pref_change_registrar_; |
| - NotificationRegistrar notification_registrar_; |
| // Whether we are currently updating preferences, this is used to ignore |
| // notifications from the preferences service that we triggered ourself. |
| bool updating_preferences_; |
| - // Do not fire any Notifications as long as we are in the constructor. |
| - bool initializing_; |
| - |
| OriginIdentifierValueMap value_map_; |
| OriginIdentifierValueMap incognito_value_map_; |