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

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

Issue 7655019: Migrate Obsolete NotificationsSettings and remove content_settings::NotificationsProvider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove include of deleted notifications_prefs_cache.h 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.cc
diff --git a/chrome/browser/content_settings/host_content_settings_map.cc b/chrome/browser/content_settings/host_content_settings_map.cc
index 3d15073c40ece187724b2e385ef29fceae11819d..16ad3a22d66fa5b1d1767958a305407092dec33f 100644
--- a/chrome/browser/content_settings/host_content_settings_map.cc
+++ b/chrome/browser/content_settings/host_content_settings_map.cc
@@ -38,7 +38,10 @@ namespace {
// 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) {
+static bool ShouldAllowAllContent(const GURL& url,
+ ContentSettingsType content_type) {
+ if (content_type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS)
+ return false;
return url.SchemeIs(chrome::kChromeDevToolsScheme) ||
url.SchemeIs(chrome::kChromeInternalScheme) ||
url.SchemeIs(chrome::kChromeUIScheme) ||
@@ -184,7 +187,7 @@ ContentSetting HostContentSettingsMap::GetCookieContentSetting(
const GURL& url,
const GURL& first_party_url,
bool setting_cookie) const {
- if (ShouldAllowAllContent(first_party_url))
+ if (ShouldAllowAllContent(first_party_url, CONTENT_SETTINGS_TYPE_COOKIES))
return CONTENT_SETTING_ALLOW;
// First get any host-specific settings.
@@ -245,7 +248,7 @@ ContentSetting HostContentSettingsMap::GetNonDefaultContentSetting(
const GURL& secondary_url,
ContentSettingsType content_type,
const std::string& resource_identifier) const {
- if (ShouldAllowAllContent(secondary_url))
+ if (ShouldAllowAllContent(secondary_url, content_type))
return CONTENT_SETTING_ALLOW;
// Iterate through the list of providers and break when the first non default
@@ -284,9 +287,6 @@ ContentSettings HostContentSettingsMap::GetContentSettings(
ContentSettings HostContentSettingsMap::GetNonDefaultContentSettings(
const GURL& primary_url,
const GURL& secondary_url) const {
- if (ShouldAllowAllContent(secondary_url))
- return ContentSettings(CONTENT_SETTING_ALLOW);
-
ContentSettings output(CONTENT_SETTING_DEFAULT);
for (int j = 0; j < CONTENT_SETTINGS_NUM_TYPES; ++j) {
output.settings[j] = GetNonDefaultContentSetting(

Powered by Google App Engine
This is Rietveld 408576698