OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 module content_settings.mojom; |
| 6 |
| 7 // This mirrors the C++ type in content_settings_pattern.h. |
| 8 struct PatternParts { |
| 9 // Lowercase string of the URL scheme to match. This string is empty if the |
| 10 // |is_scheme_wildcard| flag is set. |
| 11 string scheme; |
| 12 |
| 13 // True if the scheme wildcard is set. |
| 14 bool is_scheme_wildcard; |
| 15 |
| 16 // Normalized string that is either of the following: |
| 17 // - IPv4 or IPv6 |
| 18 // - hostname |
| 19 // - domain |
| 20 // - empty string if the |is_host_wildcard flag is set. |
| 21 string host; |
| 22 |
| 23 // True if the domain wildcard is set. |
| 24 bool has_domain_wildcard; |
| 25 |
| 26 // String with the port to match. This string is empty if the |
| 27 // |is_port_wildcard| flag is set. |
| 28 string port; |
| 29 |
| 30 // True if the port wildcard is set. |
| 31 bool is_port_wildcard; |
| 32 |
| 33 // TODO(markusheintz): Needed for legacy reasons. Remove. Path |
| 34 // specification. Only used for content settings pattern with a "file" |
| 35 // scheme part. |
| 36 string path; |
| 37 |
| 38 // True if the path wildcard is set. |
| 39 bool is_path_wildcard; |
| 40 }; |
| 41 |
| 42 // This mirrors the C++ type in content_settings_pattern.h. |
| 43 struct ContentSettingsPattern { |
| 44 PatternParts parts; |
| 45 bool is_valid; |
| 46 }; |
| 47 |
| 48 // This mirrors the C++ type in content_settings.h. |
| 49 enum ContentSetting { |
| 50 DEFAULT = 0, |
| 51 ALLOW, |
| 52 BLOCK, |
| 53 ASK, |
| 54 SESSION_ONLY, |
| 55 DETECT_IMPORTANT_CONTENT |
| 56 }; |
| 57 |
| 58 // This mirrors the C++ type in content_settings.h. |
| 59 struct ContentSettingPatternSource { |
| 60 ContentSettingsPattern primary_pattern; |
| 61 ContentSettingsPattern secondary_pattern; |
| 62 ContentSetting setting; |
| 63 string source; |
| 64 bool incognito; |
| 65 }; |
| 66 |
| 67 // This mirrors the C++ type in content_settings.h. |
| 68 struct RendererContentSettingRules { |
| 69 array<ContentSettingPatternSource> image_rules; |
| 70 array<ContentSettingPatternSource> script_rules; |
| 71 array<ContentSettingPatternSource> autoplay_rules; |
| 72 }; |
OLD | NEW |