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

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

Issue 7713034: HostContentSettingsMap refactoring. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Code review comments. Threading fixes. Mac + win fixes. Created 9 years, 4 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/host_content_settings_map.h
diff --git a/chrome/browser/content_settings/host_content_settings_map.h b/chrome/browser/content_settings/host_content_settings_map.h
index cc7150a8edcc11c2810b1b09453a947586cbeced..12a376eeeec2989539392ae6149a562a2a446da6 100644
--- a/chrome/browser/content_settings/host_content_settings_map.h
+++ b/chrome/browser/content_settings/host_content_settings_map.h
@@ -39,7 +39,6 @@ class Profile;
class HostContentSettingsMap
: public content_settings::Observer,
- public NotificationObserver,
public base::RefCountedThreadSafe<HostContentSettingsMap> {
public:
// TODO(markusheintz): I sold my soul to the devil on order to add this tuple.
@@ -79,16 +78,6 @@ class HostContentSettingsMap
ContentSettingsType content_type,
const std::string& resource_identifier) const;
- // Gets the content setting for cookies. This takes the third party cookie
- // flag into account, and therefore needs to know whether we read or write a
- // cookie.
- //
- // This may be called on any thread.
- ContentSetting GetCookieContentSetting(
- const GURL& url,
- const GURL& first_party_url,
- bool setting_cookie) const;
-
// Returns all ContentSettings which apply to the given URLs. For content
// setting types that require an additional resource identifier, the default
// content setting is returned.
@@ -150,18 +139,6 @@ class HostContentSettingsMap
static bool IsSettingAllowedForType(ContentSetting setting,
ContentSettingsType content_type);
- // This setting trumps any host-specific settings.
- bool BlockThirdPartyCookies() const { return block_third_party_cookies_; }
- bool IsBlockThirdPartyCookiesManaged() const {
- return is_block_third_party_cookies_managed_;
- }
-
- // Sets whether we block all third-party cookies. This method must not be
- // invoked on an incognito map.
- //
- // This should only be called on the UI thread.
- void SetBlockThirdPartyCookies(bool block);
-
// Returns true if the default setting for the |content_type| is managed.
bool IsDefaultContentSettingManaged(ContentSettingsType content_type) const;
@@ -178,13 +155,12 @@ class HostContentSettingsMap
ContentSettingsType content_type,
std::string resource_identifier);
- // NotificationObserver implementation.
- virtual void Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details);
+ static bool ShouldAllowAllContent(const GURL& url,
+ ContentSettingsType content_type);
private:
friend class base::RefCountedThreadSafe<HostContentSettingsMap>;
+ friend class CookieSettings;
friend class HostContentSettingsMapTest_NonDefaultSettings_Test;
virtual ~HostContentSettingsMap();
@@ -217,15 +193,9 @@ class HostContentSettingsMap
ContentSettingsType content_type,
const std::string& resource_identifier) const;
- // Various migration methods (old cookie, popup and per-host data gets
- // migrated to the new format).
- void MigrateObsoleteCookiePref();
-
// Weak; owned by the Profile.
PrefService* prefs_;
- PrefChangeRegistrar pref_change_registrar_;
-
// Whether this settings map is for an OTR session.
bool is_off_the_record_;
@@ -241,13 +211,6 @@ class HostContentSettingsMap
std::vector<linked_ptr<content_settings::ProviderInterface> >
content_settings_providers_;
- // Used around accesses to the following objects to guarantee thread safety.
- mutable base::Lock lock_;
-
- // Misc global settings.
- bool block_third_party_cookies_;
- bool is_block_third_party_cookies_managed_;
-
DISALLOW_COPY_AND_ASSIGN(HostContentSettingsMap);
};

Powered by Google App Engine
This is Rietveld 408576698