Index: components/content_settings/core/common/content_settings.mojom |
diff --git a/components/content_settings/core/common/content_settings.mojom b/components/content_settings/core/common/content_settings.mojom |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5c4c5d92a929b7ef081380b46180bdb477d0e61e |
--- /dev/null |
+++ b/components/content_settings/core/common/content_settings.mojom |
@@ -0,0 +1,72 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+module content_settings.mojom; |
+ |
+// This mirrors the C++ type in content_settings_pattern.h. |
+struct PatternParts { |
+ // Lowercase string of the URL scheme to match. This string is empty if the |
+ // |is_scheme_wildcard| flag is set. |
+ string scheme; |
+ |
+ // True if the scheme wildcard is set. |
+ bool is_scheme_wildcard; |
+ |
+ // Normalized string that is either of the following: |
+ // - IPv4 or IPv6 |
+ // - hostname |
+ // - domain |
+ // - empty string if the |is_host_wildcard flag is set. |
+ string host; |
+ |
+ // True if the domain wildcard is set. |
+ bool has_domain_wildcard; |
+ |
+ // String with the port to match. This string is empty if the |
+ // |is_port_wildcard| flag is set. |
+ string port; |
+ |
+ // True if the port wildcard is set. |
+ bool is_port_wildcard; |
+ |
+ // TODO(markusheintz): Needed for legacy reasons. Remove. Path |
+ // specification. Only used for content settings pattern with a "file" |
+ // scheme part. |
+ string path; |
+ |
+ // True if the path wildcard is set. |
+ bool is_path_wildcard; |
+}; |
+ |
+// This mirrors the C++ type in content_settings_pattern.h. |
+struct ContentSettingsPattern { |
+ PatternParts parts; |
+ bool is_valid; |
+}; |
+ |
+// This mirrors the C++ type in content_settings.h. |
+enum ContentSetting { |
+ DEFAULT = 0, |
+ ALLOW, |
+ BLOCK, |
+ ASK, |
+ SESSION_ONLY, |
+ DETECT_IMPORTANT_CONTENT |
+}; |
+ |
+// This mirrors the C++ type in content_settings.h. |
+struct ContentSettingPatternSource { |
+ ContentSettingsPattern primary_pattern; |
+ ContentSettingsPattern secondary_pattern; |
+ ContentSetting setting; |
+ string source; |
+ bool incognito; |
+}; |
+ |
+// This mirrors the C++ type in content_settings.h. |
+struct RendererContentSettingRules { |
+ array<ContentSettingPatternSource> image_rules; |
+ array<ContentSettingPatternSource> script_rules; |
+ array<ContentSettingPatternSource> autoplay_rules; |
+}; |