Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / content / public / common / renderer_preferences.h
blob13dd30fb3b924db6387fdfad7021c98a13bf9cd8
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.
4 //
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.
8 //
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_
15 #include <string>
16 #include <vector>
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"
23 namespace content {
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.
50 bool use_autohinter;
52 // Whether embedded bitmap strikes in fonts should be used.
53 // Current only used by Linux.
54 bool use_bitmaps;
56 // The type of subpixel rendering to use for text.
57 // Currently only used by Linux and Windows.
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
68 // Linux.
69 SkColor thumb_active_color;
70 SkColor thumb_inactive_color;
71 SkColor track_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|
87 // from GtkSettings.
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
113 // process.
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
117 // information.
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 // Use video-overlay (hole-punching) should be used for all video, not just
135 // encrypted video. Currently only used by Android.
136 bool use_view_overlay_for_all_video;
138 // Country iso of the mobile network for content detection purpose.
139 std::string network_contry_iso;
141 #if defined(OS_WIN)
142 // The default system font settings for caption, small caption, menu and
143 // status messages. Used only by Windows.
144 base::string16 caption_font_family_name;
145 int32 caption_font_height;
147 base::string16 small_caption_font_family_name;
148 int32 small_caption_font_height;
150 base::string16 menu_font_family_name;
151 int32 menu_font_height;
153 base::string16 status_font_family_name;
154 int32 status_font_height;
156 base::string16 message_font_family_name;
157 int32 message_font_height;
159 // The width of a vertical scroll bar in dips.
160 int32 vertical_scroll_bar_width_in_dips;
162 // The height of a horizontal scroll bar in dips.
163 int32 horizontal_scroll_bar_height_in_dips;
165 // The height of the arrow bitmap on a vertical scroll bar in dips.
166 int32 arrow_bitmap_height_vertical_scroll_bar_in_dips;
168 // The width of the arrow bitmap on a horizontal scroll bar in dips.
169 int32 arrow_bitmap_width_horizontal_scroll_bar_in_dips;
170 #endif
174 } // namespace content
176 #endif // CONTENT_PUBLIC_COMMON_RENDERER_PREFERENCES_H_