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

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

Issue 7831075: Delegating the "are images allowed" decision to renderer. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: More code review comments. Created 9 years, 3 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/tab_specific_content_settings.cc
diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc
index 6a3ee5f6fabefda1d8be31e4cba2168be1aa860b..a13d31eefdb35567aef70c0eafbb4dbb0f95cf98 100644
--- a/chrome/browser/content_settings/tab_specific_content_settings.cc
+++ b/chrome/browser/content_settings/tab_specific_content_settings.cc
@@ -419,6 +419,16 @@ void TabSpecificContentSettings::RenderViewCreated(
HostContentSettingsMap* map = profile->GetHostContentSettingsMap();
render_view_host->Send(new ChromeViewMsg_SetDefaultContentSettings(
map->GetDefaultContentSettings()));
+
+ ContentSettingsForOneType settings;
+ map->GetSettingsForOneType(
+ CONTENT_SETTINGS_TYPE_IMAGES, "",
+ &content_settings::ProviderInterface::Rule::PatternPrecedenceSort,
+ &settings);
+ settings.push_back(ContentSettingPatternSourceTuple(
+ ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(),
+ map->GetDefaultContentSetting(CONTENT_SETTINGS_TYPE_IMAGES), ""));
+ render_view_host->Send(new ChromeViewMsg_SetImageSettingRules(settings));
}
void TabSpecificContentSettings::DidStartProvisionalLoadForFrame(
@@ -471,6 +481,15 @@ void TabSpecificContentSettings::Observe(int type,
map->GetDefaultContentSettings()));
Send(new ChromeViewMsg_SetContentSettingsForCurrentURL(
entry_url, map->GetContentSettings(entry_url, entry_url)));
+ ContentSettingsForOneType settings;
+ map->GetSettingsForOneType(
+ CONTENT_SETTINGS_TYPE_IMAGES, "",
+ &content_settings::ProviderInterface::Rule::PatternPrecedenceSort,
+ &settings);
+ settings.push_back(ContentSettingPatternSourceTuple(
+ ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(),
+ map->GetDefaultContentSetting(CONTENT_SETTINGS_TYPE_IMAGES), ""));
+ Send(new ChromeViewMsg_SetImageSettingRules(settings));
}
}

Powered by Google App Engine
This is Rietveld 408576698