Index: chrome/browser/ui/webui/options/content_settings_handler.cc |
diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc |
index 99576d3b1d318df4502552924f5fe98662c907df..009541290fbd281d24366b5e8f46a4c04cb80e7d 100644 |
--- a/chrome/browser/ui/webui/options/content_settings_handler.cc |
+++ b/chrome/browser/ui/webui/options/content_settings_handler.cc |
@@ -1081,7 +1081,7 @@ void ContentSettingsHandler::GetExceptionsFromHostContentSettingsMap( |
// Keep the exceptions sorted by provider so they will be displayed in |
// precedence order. |
std::vector<std::vector<base::Value*> > all_provider_exceptions; |
- all_provider_exceptions.resize(HostContentSettingsMap::NUM_PROVIDER_TYPES); |
+ all_provider_exceptions.resize(map->GetNumProviders()); |
for (AllPatternsSettings::iterator i = all_patterns_settings.begin(); |
i != all_patterns_settings.end(); |
@@ -1098,9 +1098,19 @@ void ContentSettingsHandler::GetExceptionsFromHostContentSettingsMap( |
parent = one_settings.find(ContentSettingsPattern::Wildcard()); |
const std::string& source = i->first.second; |
- std::vector<base::Value*>* this_provider_exceptions = |
- &all_provider_exceptions.at( |
- HostContentSettingsMap::GetProviderTypeFromSource(source)); |
+ std::vector<base::Value*>* this_provider_exceptions = NULL; |
+ for (size_t j = 0; j < map->GetNumProviders(); ++j) { |
+ const content_settings::ProviderInterface* provider = |
+ map->GetProviderAt(j); |
+ if (provider->GetProviderName() == source) { |
+ this_provider_exceptions = &all_provider_exceptions.at(j); |
+ break; |
+ } |
+ } |
+ if (!this_provider_exceptions) { |
+ LOG(WARNING) << "Cannot find the provider for " << source; |
+ continue; |
+ } |
// Add the "parent" entry for the non-embedded setting. |
ContentSetting parent_setting = |