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

Unified Diff: components/content_settings/core/browser/host_content_settings_map.h

Issue 1686343002: Change HostContentSettingsMap::SetContentSetting to use GURLs instead of patterns (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments Created 4 years, 10 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: components/content_settings/core/browser/host_content_settings_map.h
diff --git a/components/content_settings/core/browser/host_content_settings_map.h b/components/content_settings/core/browser/host_content_settings_map.h
index 98fe724f79dc75b7aa9aebc0b87c4d8e0ebe80cc..2308855ba577df3201d2054365ee6bec9394aec2 100644
--- a/components/content_settings/core/browser/host_content_settings_map.h
+++ b/components/content_settings/core/browser/host_content_settings_map.h
@@ -135,19 +135,40 @@ class HostContentSettingsMap : public content_settings::Observer,
// |resource_identifier|. Setting the value to CONTENT_SETTING_DEFAULT causes
// the default setting for that type to be used when loading pages matching
// this pattern.
+ // Unless adding a custom-scoped setting, most developers will want to use
raymes 2016/03/03 01:38:19 nit: fill 80 chars on the previous line
lshang 2016/03/03 03:03:42 Done.
+ // SetContentSettingDefaultScope() instead.
// NOTICE: This is just a convenience method for content types that use
// |CONTENT_SETTING| as their data type. For content types that use other
// data types please use the method SetWebsiteSettingDefaultScope().
//
// This should only be called on the UI thread.
- // TODO(raymes): Create a version of this function which uses the default
- // scope.
void SetContentSetting(const ContentSettingsPattern& primary_pattern,
const ContentSettingsPattern& secondary_pattern,
ContentSettingsType content_type,
const std::string& resource_identifier,
ContentSetting setting);
+ // Sets the content |setting| for the default scope of the url that is
+ // appropriate for the given |content_type| and |resource_identifier|.
+ // Setting the value to CONTENT_SETTING_DEFAULT causes the default setting
+ // for that type to be used.
+ //
+ // NOTICE: This is just a convenience method for content types that use
+ // |CONTENT_SETTING| as their data type. For content types that use other
+ // data types please use the method SetWebsiteSettingDefaultScope().
+ //
+ // This should only be called on the UI thread.
+ //
+ // Internally this will call SetContentSetting() with the default scope
+ // patterns for the given |content_type|. Developers will generally want
+ // to use this function instead of SetContentSetting() unless they need
+ // to specify custom scoping.
+ void SetContentSettingDefaultScope(const GURL& primary_url,
+ const GURL& secondary_url,
+ ContentSettingsType content_type,
+ const std::string& resource_identifier,
+ ContentSetting setting);
+
// Sets the |value| for the default scope of the url that is appropriate for
// the given |content_type| and |resource_identifier|. Setting the value to
// null removes the default pattern pair for this content type.

Powered by Google App Engine
This is Rietveld 408576698