blob: bdfe1ae44f6016b8c1c89e192561f5beb6e3e8c7 [file] [log] [blame]
// Copyright 2018 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 blink.mojom;
import "mojo/public/mojom/base/string16.mojom";
import "mojo/public/mojom/base/time.mojom";
import "ui/gfx/mojom/font_render_params.mojom";
import "third_party/blink/public/mojom/user_agent/user_agent_metadata.mojom";
const int64 kDefaultCaretBlinkIntervalInMilliseconds = 500;
// User preferences needed to be passed to the renderer process.
struct RendererPreferences {
// Whether the renderer's current browser context accept drops from the OS
// that result in navigations away from the current page.
bool can_accept_load_drops = true;
// Whether text should be antialiased.
// Currently only used by Linux.
bool should_antialias_text = true;
// The level of hinting to use when rendering text.
// Currently only used by Linux.
gfx.mojom.Hinting hinting = gfx.mojom.Hinting.kMedium;
// Whether auto hinter should be used. Currently only used by Linux.
bool use_autohinter = false;
// Whether embedded bitmap strikes in fonts should be used.
// Current only used by Linux.
bool use_bitmaps = false;
// The type of subpixel rendering to use for text.
// Currently only used by Linux and Windows.
gfx.mojom.SubpixelRendering subpixel_rendering =
gfx.mojom.SubpixelRendering.kNone;
// Whether subpixel positioning should be used, permitting fractional X
// positions for glyphs. Currently only used by Linux.
bool use_subpixel_positioning = false;
// The color of the focus ring.
uint32 focus_ring_color = 0xFFE59700;
// The colors used in selection text. Currently only used on Linux and Ash.
uint32 active_selection_bg_color = 0xFF1E90FF;
uint32 active_selection_fg_color = 0xFFFFFFFF;
uint32 inactive_selection_bg_color = 0xFFC8C8C8;
uint32 inactive_selection_fg_color = 0xFF323232;
// Browser wants a look at all top-level navigation requests.
bool browser_handles_all_top_level_requests = false;
// Cursor blink rate.
// Currently only changed from default on Linux. Uses |gtk-cursor-blink|
// from GtkSettings.
// Note: Null |caret_blink_interval| should be interpreted as the default
// value kDefaultCaretBlinkIntervalInMilliseconds.
mojo_base.mojom.TimeDelta? caret_blink_interval;
// Whether or not to set custom colors at all.
bool use_custom_colors = true;
// Set to false to not send referrers.
bool enable_referrers = true;
// Set to true to allow third-party sub-content to pop-up HTTP basic auth
// dialog boxes.
bool allow_cross_origin_auth_prompt = false;
// Set to true to indicate that the preference to set DNT to 1 is enabled.
bool enable_do_not_track = false;
// Whether to allow the use of Encrypted Media Extensions (EME), except for
// the use of Clear Key key system which is always allowed as required by the
// spec.
bool enable_encrypted_media = true;
// This is the IP handling policy override for WebRTC. The value must be one
// of the strings defined in privacy.json. The allowed values are specified
// in webrtc_ip_handling_policy.h.
string webrtc_ip_handling_policy;
// This is the range of UDP ports allowed to be used by WebRTC. A value of
// zero in both fields means all ports are allowed.
uint16 webrtc_udp_min_port = 0;
uint16 webrtc_udp_max_port = 0;
array<string> webrtc_local_ips_allowed_urls;
// Whether WebRTC peer connections are allowed to use legacy versions of the
// TLS/DTLS protocols.
bool webrtc_allow_legacy_tls_protocols = false;
// The user agent given to WebKit when it requests one and the user agent is
// being overridden for the current navigation.
UserAgentOverride user_agent_override;
// The accept-languages of the browser, comma-separated.
string accept_languages;
// Determines whether plugins are allowed to enter fullscreen mode.
bool plugin_fullscreen_allowed = true;
// Whether or not caret browsing is enabled.
bool caret_browsing_enabled = false;
[EnableIf=renderer_pref_system_font_family_name]
string system_font_family_name;
// The default system font settings for caption, small caption, menu and
// status messages. Used only by Windows.
// TODO(https://crbug.com/869748): Consolidate all fields below into a new
// Win-only mojom struct to avoid using a [EnableIf=is_win] for each of them.
[EnableIf=is_win]
mojo_base.mojom.String16 caption_font_family_name;
[EnableIf=is_win]
int32 caption_font_height = 0;
[EnableIf=is_win]
mojo_base.mojom.String16 small_caption_font_family_name;
[EnableIf=is_win]
int32 small_caption_font_height = 0;
[EnableIf=is_win]
mojo_base.mojom.String16 menu_font_family_name;
[EnableIf=is_win]
int32 menu_font_height = 0;
[EnableIf=is_win]
mojo_base.mojom.String16 status_font_family_name;
[EnableIf=is_win]
int32 status_font_height = 0;
[EnableIf=is_win]
mojo_base.mojom.String16 message_font_family_name;
[EnableIf=is_win]
int32 message_font_height = 0;
// The width of a vertical scroll bar in dips.
[EnableIf=is_win]
int32 vertical_scroll_bar_width_in_dips = 0;
// The height of a horizontal scroll bar in dips.
[EnableIf=is_win]
int32 horizontal_scroll_bar_height_in_dips = 0;
// The height of the arrow bitmap on a vertical scroll bar in dips.
[EnableIf=is_win]
int32 arrow_bitmap_height_vertical_scroll_bar_in_dips = 0;
// The width of the arrow bitmap on a horizontal scroll bar in dips.
[EnableIf=is_win]
int32 arrow_bitmap_width_horizontal_scroll_bar_in_dips = 0;
// Whether the selection clipboard buffer is available. Linux environments
// may support this.
[EnableIf=is_selection_clipboard_buffer_possible]
bool selection_clipboard_buffer_available = false;
};