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..a122219ec3ab38a114fcc23da55d70cf5de10d22 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 |
+ // ContentSettingsPattern precedence relation. |
+ 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) { |