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 "content/common/content_export.h"
19 #include "third_party/skia/include/core/SkColor.h"
23 enum RendererPreferencesHintingEnum
{
24 RENDERER_PREFERENCES_HINTING_SYSTEM_DEFAULT
= 0,
25 RENDERER_PREFERENCES_HINTING_NONE
,
26 RENDERER_PREFERENCES_HINTING_SLIGHT
,
27 RENDERER_PREFERENCES_HINTING_MEDIUM
,
28 RENDERER_PREFERENCES_HINTING_FULL
,
31 enum RendererPreferencesSubpixelRenderingEnum
{
32 RENDERER_PREFERENCES_SUBPIXEL_RENDERING_SYSTEM_DEFAULT
= 0,
33 RENDERER_PREFERENCES_SUBPIXEL_RENDERING_NONE
,
34 RENDERER_PREFERENCES_SUBPIXEL_RENDERING_RGB
,
35 RENDERER_PREFERENCES_SUBPIXEL_RENDERING_BGR
,
36 RENDERER_PREFERENCES_SUBPIXEL_RENDERING_VRGB
,
37 RENDERER_PREFERENCES_SUBPIXEL_RENDERING_VBGR
,
40 enum TapMultipleTargetsStrategy
{
41 TAP_MULTIPLE_TARGETS_STRATEGY_ZOOM
= 0,
42 TAP_MULTIPLE_TARGETS_STRATEGY_POPUP
,
43 TAP_MULTIPLE_TARGETS_STRATEGY_NONE
,
45 TAP_MULTIPLE_TARGETS_STRATEGY_MAX
= TAP_MULTIPLE_TARGETS_STRATEGY_NONE
,
48 struct CONTENT_EXPORT RendererPreferences
{
49 RendererPreferences();
50 ~RendererPreferences();
52 // Whether the renderer's current browser context accept drops from the OS
53 // that result in navigations away from the current page.
54 bool can_accept_load_drops
;
56 // Whether text should be antialiased.
57 // Currently only used by Linux.
58 bool should_antialias_text
;
60 // The level of hinting to use when rendering text.
61 // Currently only used by Linux.
62 RendererPreferencesHintingEnum hinting
;
64 // Whether auto hinter should be used. Currently only used by Linux.
67 // Whether embedded bitmap strikes in fonts should be used.
68 // Current only used by Linux.
71 // The type of subpixel rendering to use for text.
72 // Currently only used by Linux.
73 RendererPreferencesSubpixelRenderingEnum subpixel_rendering
;
75 // Whether subpixel positioning should be used, permitting fractional X
76 // positions for glyphs. Currently only used by Linux.
77 bool use_subpixel_positioning
;
79 // The color of the focus ring. Currently only used on Linux.
80 SkColor focus_ring_color
;
82 // The color of different parts of the scrollbar. Currently only used on
84 SkColor thumb_active_color
;
85 SkColor thumb_inactive_color
;
88 // The colors used in selection text. Currently only used on Linux and Ash.
89 SkColor active_selection_bg_color
;
90 SkColor active_selection_fg_color
;
91 SkColor inactive_selection_bg_color
;
92 SkColor inactive_selection_fg_color
;
94 // Browser wants a look at all non-local top level navigation requests.
95 bool browser_handles_non_local_top_level_requests
;
97 // Browser wants a look at all top-level navigation requests.
98 bool browser_handles_all_top_level_requests
;
100 // Cursor blink rate in seconds.
101 // Currently only changed from default on Linux. Uses |gtk-cursor-blink|
103 double caret_blink_interval
;
105 // Whether or not to set custom colors at all.
106 bool use_custom_colors
;
108 // Set to false to not send referrers.
109 bool enable_referrers
;
111 // Set to true to indicate that the preference to set DNT to 1 is enabled.
112 bool enable_do_not_track
;
114 // Default page zoom level.
115 double default_zoom_level
;
117 // The user agent given to WebKit when it requests one and the user agent is
118 // being overridden for the current navigation.
119 std::string user_agent_override
;
121 // The accept-languages of the browser, comma-separated.
122 std::string accept_languages
;
124 // Specifies whether the renderer reports frame name changes to the browser
126 // TODO(fsamuel): This is a short-term workaround to avoid regressing
127 // Sunspider. We need to find an efficient way to report changes to frame
128 // names to the browser process. See http://crbug.com/169110 for more
130 bool report_frame_name_changes
;
132 // Controls deacceleration of touchpad-initiated flings.
133 std::vector
<float> touchpad_fling_profile
;
135 // Controls deacceleration of touchscreen-initiated flings.
136 std::vector
<float> touchscreen_fling_profile
;
138 // How to handle a tap gesture touching multiple targets
139 TapMultipleTargetsStrategy tap_multiple_targets_strategy
;
141 // Disables rendering default error page when client choses to block a page.
142 // Corresponds to net::ERR_BLOCKED_BY_CLIENT.
143 bool disable_client_blocked_error_page
;
145 // Determines whether plugins are allowed to enter fullscreen mode.
146 bool plugin_fullscreen_allowed
;
148 // Whether video-overlay (hole-punching) should be used for the embedded
149 // encrypted video. Currently only used by Android.
150 bool use_video_overlay_for_embedded_encrypted_video
;
153 } // namespace content
155 #endif // CONTENT_PUBLIC_COMMON_RENDERER_PREFERENCES_H_