1 // Copyright (c) 2012 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.
5 // A struct for managing browser's settings that apply to the renderer or its
6 // webview. These differ from WebPreferences since they apply to Chromium's
7 // glue layer rather than applying to just WebKit.
9 // Adding new values to this class probably involves updating
10 // common/view_messages.h, browser/browser.cc, etc.
12 #ifndef CONTENT_PUBLIC_COMMON_RENDERER_PREFERENCES_H_
13 #define CONTENT_PUBLIC_COMMON_RENDERER_PREFERENCES_H_
18 #include "base/strings/string16.h"
19 #include "content/common/content_export.h"
20 #include "third_party/skia/include/core/SkColor.h"
21 #include "ui/gfx/font_render_params.h"
25 enum TapMultipleTargetsStrategy
{
26 TAP_MULTIPLE_TARGETS_STRATEGY_ZOOM
= 0,
27 TAP_MULTIPLE_TARGETS_STRATEGY_POPUP
,
28 TAP_MULTIPLE_TARGETS_STRATEGY_NONE
,
30 TAP_MULTIPLE_TARGETS_STRATEGY_MAX
= TAP_MULTIPLE_TARGETS_STRATEGY_NONE
,
33 struct CONTENT_EXPORT RendererPreferences
{
34 RendererPreferences();
35 ~RendererPreferences();
37 // Whether the renderer's current browser context accept drops from the OS
38 // that result in navigations away from the current page.
39 bool can_accept_load_drops
;
41 // Whether text should be antialiased.
42 // Currently only used by Linux.
43 bool should_antialias_text
;
45 // The level of hinting to use when rendering text.
46 // Currently only used by Linux.
47 gfx::FontRenderParams::Hinting hinting
;
49 // Whether auto hinter should be used. Currently only used by Linux.
52 // Whether embedded bitmap strikes in fonts should be used.
53 // Current only used by Linux.
56 // The type of subpixel rendering to use for text.
57 // Currently only used by Linux.
58 gfx::FontRenderParams::SubpixelRendering subpixel_rendering
;
60 // Whether subpixel positioning should be used, permitting fractional X
61 // positions for glyphs. Currently only used by Linux.
62 bool use_subpixel_positioning
;
64 // The color of the focus ring. Currently only used on Linux.
65 SkColor focus_ring_color
;
67 // The color of different parts of the scrollbar. Currently only used on
69 SkColor thumb_active_color
;
70 SkColor thumb_inactive_color
;
73 // The colors used in selection text. Currently only used on Linux and Ash.
74 SkColor active_selection_bg_color
;
75 SkColor active_selection_fg_color
;
76 SkColor inactive_selection_bg_color
;
77 SkColor inactive_selection_fg_color
;
79 // Browser wants a look at all non-local top level navigation requests.
80 bool browser_handles_non_local_top_level_requests
;
82 // Browser wants a look at all top-level navigation requests.
83 bool browser_handles_all_top_level_requests
;
85 // Cursor blink rate in seconds.
86 // Currently only changed from default on Linux. Uses |gtk-cursor-blink|
88 double caret_blink_interval
;
90 // Whether or not to set custom colors at all.
91 bool use_custom_colors
;
93 // Set to false to not send referrers.
94 bool enable_referrers
;
96 // Set to true to indicate that the preference to set DNT to 1 is enabled.
97 bool enable_do_not_track
;
99 // Set to false to indicate that WebRTC should use the OS default routing.
100 bool enable_webrtc_multiple_routes
;
102 // Default page zoom level.
103 double default_zoom_level
;
105 // The user agent given to WebKit when it requests one and the user agent is
106 // being overridden for the current navigation.
107 std::string user_agent_override
;
109 // The accept-languages of the browser, comma-separated.
110 std::string accept_languages
;
112 // Specifies whether the renderer reports frame name changes to the browser
114 // TODO(fsamuel): This is a short-term workaround to avoid regressing
115 // Sunspider. We need to find an efficient way to report changes to frame
116 // names to the browser process. See http://crbug.com/169110 for more
118 bool report_frame_name_changes
;
120 // How to handle a tap gesture touching multiple targets
121 TapMultipleTargetsStrategy tap_multiple_targets_strategy
;
123 // Disables rendering default error page when client choses to block a page.
124 // Corresponds to net::ERR_BLOCKED_BY_CLIENT.
125 bool disable_client_blocked_error_page
;
127 // Determines whether plugins are allowed to enter fullscreen mode.
128 bool plugin_fullscreen_allowed
;
130 // Whether video-overlay (hole-punching) should be used for the embedded
131 // encrypted video. Currently only used by Android.
132 bool use_video_overlay_for_embedded_encrypted_video
;
134 // The default system font settings for caption, small caption, menu and
135 // status messages. Used only by Windows.
136 base::string16 caption_font_family_name
;
137 int32 caption_font_height
;
139 base::string16 small_caption_font_family_name
;
140 int32 small_caption_font_height
;
142 base::string16 menu_font_family_name
;
143 int32 menu_font_height
;
145 base::string16 status_font_family_name
;
146 int32 status_font_height
;
148 base::string16 message_font_family_name
;
149 int32 message_font_height
;
152 } // namespace content
154 #endif // CONTENT_PUBLIC_COMMON_RENDERER_PREFERENCES_H_