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

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

Issue 8383004: Adding CookieSettings for storing cookie content settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 2 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 4c167b991bfc1c529845b686eb13419db7fcda20..0e39e6ce98b03a667ecd1ea0e4d4b69bfe88e7f3 100644
--- a/chrome/browser/content_settings/host_content_settings_map.h
+++ b/chrome/browser/content_settings/host_content_settings_map.h
@@ -77,12 +77,12 @@ class HostContentSettingsMap
// This may be called on any thread.
ContentSettings GetDefaultContentSettings() const;
- // Returns a single |ContentSetting| which applies to the given URLs.
- // Note that certain internal schemes are whitelisted.
- // For |CONTENT_TYPE_COOKIES|, |GetCookieContentSetting| should be called,
- // and for content types that can't be converted to a ContentSetting,
- // |GetContentSettingValue| should be called.
+ // Returns a single |ContentSetting| which applies to the given URLs. Note
+ // that certain internal schemes are whitelisted. For |CONTENT_TYPE_COOKIES|,
+ // |CookieSettings| should be used instead. For content types that can't be
+ // converted to a |ContentSetting|, |GetContentSettingValue| should be called.
// If there is no content setting, returns CONTENT_SETTING_DEFAULT.
+ //
// May be called on any thread.
ContentSetting GetContentSetting(
const GURL& primary_url,
@@ -106,24 +106,13 @@ class HostContentSettingsMap
ContentSettingsPattern* primary_pattern,
ContentSettingsPattern* secondary_pattern) 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.
+ // Returns all ContentSettings which apply to the given |primary_url|. For
+ // content setting types that require an additional resource identifier, the
+ // default content setting is returned.
//
// This may be called on any thread.
ContentSettings GetContentSettings(
- const GURL& primary_url,
- const GURL& secondary_url) const;
+ const GURL& primary_url) const;
// For a given content type, returns all patterns with a non-default setting,
// mapped to their actual settings, in lexicographical order. |settings|
@@ -207,6 +196,12 @@ class HostContentSettingsMap
const content::NotificationSource& source,
const content::NotificationDetails& details);
+ // Returns true if we should allow all content types for this URL. This is
+ // true for various internal objects like chrome:// URLs, so UI and other
+ // things users think of as "not webpages" don't break.
+ static bool ShouldAllowAllContent(const GURL& url,
+ ContentSettingsType content_type);
+
private:
friend class base::RefCountedThreadSafe<HostContentSettingsMap>;
friend class HostContentSettingsMapTest_NonDefaultSettings_Test;

Powered by Google App Engine
This is Rietveld 408576698