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

Unified Diff: chrome/browser/host_content_settings_map.h

Issue 3068005: Flesh out the content settings exceptions lists a bit more. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: reduce instance vars Created 10 years, 5 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 | « chrome/browser/dom_ui/content_settings_handler.cc ('k') | chrome/browser/host_content_settings_map.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/host_content_settings_map.h
diff --git a/chrome/browser/host_content_settings_map.h b/chrome/browser/host_content_settings_map.h
index 5800cea5d8544fb3345da6a1df3b78da10b2e2d6..23481387b83a2ea36d525aa212278d92e9790267 100644
--- a/chrome/browser/host_content_settings_map.h
+++ b/chrome/browser/host_content_settings_map.h
@@ -73,21 +73,34 @@ class HostContentSettingsMap
// for each pattern.
class ContentSettingsDetails {
public:
- explicit ContentSettingsDetails(const Pattern& pattern)
- : pattern_(pattern), update_all_(false) {}
+ // Update the setting that matches this pattern/content type.
+ ContentSettingsDetails(const Pattern& pattern, ContentSettingsType type)
+ : pattern_(pattern), type_(type) {}
- explicit ContentSettingsDetails(bool update_all)
- : pattern_(), update_all_(update_all) {}
+ // No pattern is specified. Update all settings for this content type.
+ explicit ContentSettingsDetails(ContentSettingsType type) : type_(type) {}
+
+ // No content type or pattern is specified. Update all settings.
+ ContentSettingsDetails() : type_(CONTENT_SETTINGS_TYPE_DEFAULT) {}
// The pattern whose settings have changed.
const Pattern& pattern() const { return pattern_; }
- // True if many settings changed at once.
- bool update_all() const { return update_all_; }
+ // True if all settings should be updated for the given type.
+ bool update_all() const { return pattern_.AsString().empty(); }
+
+ // The type of the pattern whose settings have changed.
+ ContentSettingsType type() const { return type_; }
+
+ // True if all types should be updated. If update_all() is false, this will
+ // be false as well (although the reverse does not hold true).
+ bool update_all_types() const {
+ return CONTENT_SETTINGS_TYPE_DEFAULT == type_;
+ }
private:
Pattern pattern_;
- bool update_all_;
+ ContentSettingsType type_;
};
« no previous file with comments | « chrome/browser/dom_ui/content_settings_handler.cc ('k') | chrome/browser/host_content_settings_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698