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

Unified Diff: chrome/browser/content_settings/content_settings_pref_provider.h

Issue 7049007: Origin Identifier Value Map. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 6 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/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..4e00ae516acafc554b3b187d4a21b7c56f4270cb 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,7 @@ class PrefProvider : public BaseProvider,
explicit PrefProvider(Profile* profile);
virtual ~PrefProvider();
+ // ProviderInterface implementations.
virtual void SetContentSetting(
const ContentSettingsPattern& requesting_pattern,
const ContentSettingsPattern& embedding_pattern,
@@ -114,20 +116,30 @@ 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,
const NotificationDetails& details);
private:
+ void Init();
+
void ReadExceptions(bool overwrite);
// Various migration methods (old cookie, popup and per-host data gets
@@ -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);
};

Powered by Google App Engine
This is Rietveld 408576698