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 479ddd14bb54d6b09e0bb2c12984c73516c2a2b7..4ab3ce6a884b871b176551719b5e3d21ee5202b6 100644 |
| --- a/chrome/browser/content_settings/content_settings_pref_provider.h |
| +++ b/chrome/browser/content_settings/content_settings_pref_provider.h |
| @@ -14,8 +14,9 @@ |
| #include "base/basictypes.h" |
| #include "base/synchronization/lock.h" |
| -#include "chrome/browser/content_settings/content_settings_base_provider.h" |
| +#include "chrome/browser/content_settings/content_settings_origin_identifier_value_map.h" |
| #include "chrome/browser/content_settings/content_settings_provider.h" |
| +#include "chrome/browser/content_settings/content_settings_utils.h" |
| #include "chrome/browser/prefs/pref_change_registrar.h" |
| #include "content/common/notification_observer.h" |
| #include "content/common/notification_registrar.h" |
| @@ -99,7 +100,7 @@ class PrefDefaultProvider : public DefaultProviderInterface, |
| // Content settings provider that provides content settings from the user |
| // preference. |
| -class PrefProvider : public BaseProvider, |
| +class PrefProvider : public ProviderInterface, |
| public NotificationObserver { |
| public: |
| static void RegisterUserPrefs(PrefService* prefs); |
| @@ -107,6 +108,9 @@ class PrefProvider : public BaseProvider, |
| explicit PrefProvider(Profile* profile); |
| virtual ~PrefProvider(); |
| + // ProviderInterface implementations. |
|
Bernhard Bauer
2011/05/26 23:14:42
No, this one's not. It should be non-virtual and p
markusheintz_
2011/05/31 11:46:41
Thanks for catching this. This used to override th
|
| + virtual void Init(); |
| + |
| virtual void SetContentSetting( |
| const ContentSettingsPattern& requesting_pattern, |
| const ContentSettingsPattern& embedding_pattern, |
| @@ -114,14 +118,22 @@ class PrefProvider : public BaseProvider, |
| const ResourceIdentifier& resource_identifier, |
| ContentSetting content_setting); |
| + virtual ContentSetting GetContentSetting( |
| + const GURL& requesting_url, |
| + const GURL& embedding_url, |
| + ContentSettingsType content_type, |
| + const ResourceIdentifier& resource_identifier) const; |
| + |
| + virtual void GetAllContentSettingsRules( |
| + ContentSettingsType content_type, |
| + const ResourceIdentifier& resource_identifier, |
| + Rules* content_setting_rules) const; |
| + |
| virtual void ClearAllContentSettingsRules( |
| ContentSettingsType content_type); |
| virtual void ResetToDefaults(); |
| - // BaseProvider implementations. |
| - virtual void Init(); |
| - |
| // NotificationObserver implementation. |
| virtual void Observe(NotificationType type, |
| const NotificationSource& source, |
| @@ -138,20 +150,14 @@ class PrefProvider : public BaseProvider, |
| void CanonicalizeContentSettingsExceptions( |
| DictionaryValue* all_settings_dictionary); |
| - void GetSettingsFromDictionary( |
| - const DictionaryValue* dictionary, |
| - ContentSettings* settings); |
| - |
| - void GetResourceSettingsFromDictionary( |
| - const DictionaryValue* dictionary, |
| - ResourceContentSettings* settings); |
| - |
| void NotifyObservers(const ContentSettingsDetails& details); |
| void UnregisterObservers(); |
| Profile* profile_; |
| + bool is_incognito_; |
| + |
| PrefChangeRegistrar pref_change_registrar_; |
| NotificationRegistrar notification_registrar_; |
| @@ -162,6 +168,14 @@ class PrefProvider : public BaseProvider, |
| // Do not fire any Notifications as long as we are in the constructor. |
| bool initializing_; |
| + OriginIdentifierValueMap value_map_; |
| + |
| + OriginIdentifierValueMap incognito_value_map_; |
| + |
| + // Used around accesses to the value map objects to guarantee |
| + // thread safety. |
| + mutable base::Lock lock_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(PrefProvider); |
| }; |