Index: components/content_settings/core/common/content_settings_pattern.h |
diff --git a/components/content_settings/core/common/content_settings_pattern.h b/components/content_settings/core/common/content_settings_pattern.h |
index b5b83529b00f92b431157744a22fa4e9abebb3bb..fc7b6091f07caf7b35d29bf00adecae73e50e0e5 100644 |
--- a/components/content_settings/core/common/content_settings_pattern.h |
+++ b/components/content_settings/core/common/content_settings_pattern.h |
@@ -53,6 +53,19 @@ class ContentSettingsPattern { |
DISJOINT_ORDER_PRE = 2, |
}; |
+ // This enum is used to back an UMA histogram, the order of existing values |
+ // should not be changed. New values should only append before SCHEME_MAX. |
+ // Also keep it consistent with kSchemeNames in content_settings_pattern.cc. |
+ enum SchemeType { |
+ SCHEME_WILDCARD, |
+ SCHEME_OTHER, |
+ SCHEME_HTTP, |
+ SCHEME_HTTPS, |
+ SCHEME_FILE, |
+ SCHEME_CHROMEEXTENSION, |
+ SCHEME_MAX, |
+ }; |
+ |
struct PatternParts { |
PatternParts(); |
PatternParts(const PatternParts& other); |
@@ -178,6 +191,9 @@ class ContentSettingsPattern { |
// Returns a std::string representation of this pattern. |
std::string ToString() const; |
+ // Returns scheme type of pattern. |
+ ContentSettingsPattern::SchemeType GetScheme() const; |
+ |
// Compares the pattern with a given |other| pattern and returns the |
// |Relation| of the two patterns. |
Relation Compare(const ContentSettingsPattern& other) const; |