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

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

Issue 7831075: Delegating the "are images allowed" decision to renderer. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Transmit image settings to the renderer. Draft. 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/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 f05ef0acdc5b38d317b108dac41eff3454b53e6f..2493d81647262b4bc5d2ebe2b5ad98c631be57dd 100644
--- a/chrome/browser/content_settings/host_content_settings_map.cc
+++ b/chrome/browser/content_settings/host_content_settings_map.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/content_settings/host_content_settings_map.h"
+#include <algorithm>
#include <list>
#include "base/command_line.h"
@@ -384,6 +385,38 @@ void HostContentSettingsMap::GetSettingsForOneType(
}
}
+void HostContentSettingsMap::GetConcatenatedSettingsForOneType(
+ ContentSettingsType content_type,
+ const std::string& resource_identifier,
+ ContentSettingRules* rules) const {
+ DCHECK_NE(content_settings::RequiresResourceIdentifier(content_type),
+ resource_identifier.empty());
+ DCHECK(rules);
+
+ rules->clear();
+ for (size_t i = 0; i < content_settings_providers_.size(); ++i) {
+ // Get rules from the content settings provider.
+ Rules rules_for_provider;
+ content_settings_providers_[i]->GetAllContentSettingsRules(
+ content_type, resource_identifier, &rules_for_provider);
+
+ // The rules are returned in arbitrary order. Sort them according to the
+ // ContentSettingPattern precedence relation.
Bernhard Bauer 2011/09/13 17:38:11 Uhhh… is this going to work? The precedence relati
marja 2011/09/15 12:02:00 Hmm, what would go wrong? Sorting should be ok eve
Bernhard Bauer 2011/09/15 12:52:19 Hm, I guess the most important property is transit
marja 2011/09/15 16:00:03 markusheintz had some diabolic-soul-merchandise go
+ std::sort(rules_for_provider.begin(), rules_for_provider.end());
+
+ for (Rules::const_iterator i = rules_for_provider.begin();
+ i != rules_for_provider.end(); ++i) {
+ rules->push_back(ContentSettingPatternTuple(i->primary_pattern,
+ i->secondary_pattern,
+ i->content_setting));
+ }
+ }
+ rules->push_back(ContentSettingPatternTuple(
+ ContentSettingsPattern::Wildcard(),
+ ContentSettingsPattern::Wildcard(),
+ GetDefaultContentSetting(content_type)));
+}
+
void HostContentSettingsMap::SetDefaultContentSetting(
ContentSettingsType content_type,
ContentSetting setting) {

Powered by Google App Engine
This is Rietveld 408576698