| // 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; |
| |
| import "mojo/public/mojom/base/values.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; |
| mojo_base.mojom.Value setting_value; |
| 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; |
| array<ContentSettingPatternSource> client_hints_rules; |
| array<ContentSettingPatternSource> popup_redirect_rules; |
| }; |