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

Unified Diff: chrome/browser/ui/webui/options/content_settings_handler.cc

Issue 545413002: Detach the dependency from host_content_settings_map to extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove ProviderType Created 6 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/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 =

Powered by Google App Engine
This is Rietveld 408576698