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

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

Issue 1047153002: Show content settings exceptions in correct order (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Show content settings exceptions in correct order Created 5 years, 9 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
« no previous file with comments | « no previous file | components/content_settings/core/common/content_settings_pattern_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 562ea7cf2c59b810e42de1a2f39317f35fe350e0..a52bbc41863309aecde62f9a7be736945fbd434b 100644
--- a/chrome/browser/ui/webui/options/content_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
@@ -1173,8 +1173,12 @@ void ContentSettingsHandler::GetExceptionsFromHostContentSettingsMap(
std::vector<std::vector<base::Value*> > all_provider_exceptions;
all_provider_exceptions.resize(HostContentSettingsMap::NUM_PROVIDER_TYPES);
- for (AllPatternsSettings::iterator i = all_patterns_settings.begin();
- i != all_patterns_settings.end();
+ // The all_patterns_settings is sorted from the lowest precedence pattern to
+ // the highest (see operator< in ContentSettingsPattern), so traverse it in
+ // reverse to show the patterns with the highest precedence (the more specific
+ // ones) on the top.
+ for (AllPatternsSettings::reverse_iterator i = all_patterns_settings.rbegin();
+ i != all_patterns_settings.rend();
++i) {
const ContentSettingsPattern& primary_pattern = i->first.first;
const OnePatternSettings& one_settings = i->second;
« no previous file with comments | « no previous file | components/content_settings/core/common/content_settings_pattern_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698