ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / content / public / common / web_preferences.h
blob250b546dc437db167a71ae836e6f5cfcff304251
1 // Copyright 2014 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 #ifndef CONTENT_PUBLIC_COMMON_WEB_PREFERENCES_H_
6 #define CONTENT_PUBLIC_COMMON_WEB_PREFERENCES_H_
8 #include <map>
9 #include <string>
10 #include <vector>
12 #include "base/strings/string16.h"
13 #include "content/common/content_export.h"
14 #include "net/base/network_change_notifier.h"
15 #include "ui/base/touch/touch_device.h"
16 #include "url/gurl.h"
18 namespace blink {
19 class WebView;
22 namespace content {
24 // Map of ISO 15924 four-letter script code to font family. For example,
25 // "Arab" to "My Arabic Font".
26 typedef std::map<std::string, base::string16> ScriptFontFamilyMap;
28 enum EditingBehavior {
29 EDITING_BEHAVIOR_MAC,
30 EDITING_BEHAVIOR_WIN,
31 EDITING_BEHAVIOR_UNIX,
32 EDITING_BEHAVIOR_ANDROID,
33 EDITING_BEHAVIOR_LAST = EDITING_BEHAVIOR_ANDROID
36 // Cache options for V8. See V8CacheOptions.h for information on the options.
37 enum V8CacheOptions {
38 V8_CACHE_OPTIONS_DEFAULT,
39 V8_CACHE_OPTIONS_PARSE,
40 V8_CACHE_OPTIONS_CODE,
41 V8_CACHE_OPTIONS_CODE_COMPRESSED,
42 V8_CACHE_OPTIONS_NONE,
43 V8_CACHE_OPTIONS_PARSE_MEMORY,
44 V8_CACHE_OPTIONS_HEURISTICS,
45 V8_CACHE_OPTIONS_HEURISTICS_MOBILE,
46 V8_CACHE_OPTIONS_HEURISTICS_DEFAULT,
47 V8_CACHE_OPTIONS_HEURISTICS_DEFAULT_MOBILE,
48 V8_CACHE_OPTIONS_RECENT,
49 V8_CACHE_OPTIONS_RECENT_SMALL,
50 V8_CACHE_OPTIONS_LAST = V8_CACHE_OPTIONS_RECENT_SMALL
53 // ImageAnimationPolicy is used for controlling image animation
54 // when image frame is rendered for animation.
55 // See third_party/WebKit/Source/platform/graphics/ImageAnimationPolicy.h
56 // for information on the options.
57 enum ImageAnimationPolicy {
58 IMAGE_ANIMATION_POLICY_ALLOWED,
59 IMAGE_ANIMATION_POLICY_ANIMATION_ONCE,
60 IMAGE_ANIMATION_POLICY_NO_ANIMATION
63 // The ISO 15924 script code for undetermined script aka Common. It's the
64 // default used on WebKit's side to get/set a font setting when no script is
65 // specified.
66 CONTENT_EXPORT extern const char kCommonScript[];
68 // A struct for managing blink's settings.
70 // Adding new values to this class probably involves updating
71 // blink::WebSettings, content/common/view_messages.h, browser/tab_contents/
72 // render_view_host_delegate_helper.cc, and browser/profiles/profile.cc.
73 struct CONTENT_EXPORT WebPreferences {
74 ScriptFontFamilyMap standard_font_family_map;
75 ScriptFontFamilyMap fixed_font_family_map;
76 ScriptFontFamilyMap serif_font_family_map;
77 ScriptFontFamilyMap sans_serif_font_family_map;
78 ScriptFontFamilyMap cursive_font_family_map;
79 ScriptFontFamilyMap fantasy_font_family_map;
80 ScriptFontFamilyMap pictograph_font_family_map;
81 int default_font_size;
82 int default_fixed_font_size;
83 int minimum_font_size;
84 int minimum_logical_font_size;
85 std::string default_encoding;
86 bool javascript_enabled;
87 bool web_security_enabled;
88 bool javascript_can_open_windows_automatically;
89 bool loads_images_automatically;
90 bool images_enabled;
91 bool plugins_enabled;
92 bool dom_paste_enabled;
93 bool shrinks_standalone_images_to_fit;
94 bool uses_universal_detector;
95 bool text_areas_are_resizable;
96 bool java_enabled;
97 bool allow_scripts_to_close_windows;
98 bool remote_fonts_enabled;
99 bool javascript_can_access_clipboard;
100 bool xslt_enabled;
101 bool xss_auditor_enabled;
102 // We don't use dns_prefetching_enabled to disable DNS prefetching. Instead,
103 // we disable the feature at a lower layer so that we catch non-WebKit uses
104 // of DNS prefetch as well.
105 bool dns_prefetching_enabled;
106 bool local_storage_enabled;
107 bool databases_enabled;
108 bool application_cache_enabled;
109 bool tabs_to_links;
110 bool caret_browsing_enabled;
111 bool hyperlink_auditing_enabled;
112 bool is_online;
113 net::NetworkChangeNotifier::ConnectionType connection_type;
114 bool allow_universal_access_from_file_urls;
115 bool allow_file_access_from_file_urls;
116 bool webaudio_enabled;
117 bool experimental_webgl_enabled;
118 bool pepper_3d_enabled;
119 bool flash_3d_enabled;
120 bool flash_stage3d_enabled;
121 bool flash_stage3d_baseline_enabled;
122 bool gl_multisampling_enabled;
123 bool privileged_webgl_extensions_enabled;
124 bool webgl_errors_to_console_enabled;
125 bool mock_scrollbars_enabled;
126 bool asynchronous_spell_checking_enabled;
127 bool unified_textchecker_enabled;
128 bool accelerated_2d_canvas_enabled;
129 int minimum_accelerated_2d_canvas_size;
130 bool antialiased_2d_canvas_disabled;
131 bool antialiased_clips_2d_canvas_enabled;
132 int accelerated_2d_canvas_msaa_sample_count;
133 bool accelerated_filters_enabled;
134 bool deferred_filters_enabled;
135 bool container_culling_enabled;
136 bool text_blobs_enabled;
137 bool allow_displaying_insecure_content;
138 bool allow_running_insecure_content;
139 // If true, taints all <canvas> elements, regardless of origin.
140 bool disable_reading_from_canvas;
141 // Strict mixed content checking disables both displaying and running insecure
142 // mixed content, and disables embedder notifications that such content was
143 // requested (thereby preventing user override).
144 bool strict_mixed_content_checking;
145 // Strict powerful feature restrictions block insecure usage of powerful
146 // features (like geolocation) that we haven't yet disabled for the web at
147 // large.
148 bool strict_powerful_feature_restrictions;
149 bool password_echo_enabled;
150 bool should_print_backgrounds;
151 bool should_clear_document_background;
152 bool enable_scroll_animator;
153 bool css_variables_enabled;
154 bool region_based_columns_enabled;
155 bool touch_enabled;
156 // TODO(mustaq): Nuke when the new API is ready
157 bool device_supports_touch;
158 // TODO(mustaq): Nuke when the new API is ready
159 bool device_supports_mouse;
160 bool touch_adjustment_enabled;
161 int pointer_events_max_touch_points;
162 int available_pointer_types;
163 ui::PointerType primary_pointer_type;
164 int available_hover_types;
165 ui::HoverType primary_hover_type;
166 bool sync_xhr_in_documents_enabled;
167 bool deferred_image_decoding_enabled;
168 bool image_color_profiles_enabled;
169 bool should_respect_image_orientation;
170 int number_of_cpu_cores;
171 EditingBehavior editing_behavior;
172 bool supports_multiple_windows;
173 bool viewport_enabled;
174 bool viewport_meta_enabled;
175 bool main_frame_resizes_are_orientation_changes;
176 bool initialize_at_minimum_page_scale;
177 bool smart_insert_delete_enabled;
178 bool spatial_navigation_enabled;
179 bool pinch_virtual_viewport_enabled;
180 int pinch_overlay_scrollbar_thickness;
181 bool rubber_banding_on_compositor_thread;
182 bool use_solid_color_scrollbars;
183 bool navigate_on_drag_drop;
184 V8CacheOptions v8_cache_options;
185 bool slimming_paint_enabled;
187 // This flags corresponds to a Page's Settings' setCookieEnabled state. It
188 // only controls whether or not the "document.cookie" field is properly
189 // connected to the backing store, for instance if you wanted to be able to
190 // define custom getters and setters from within a unique security content
191 // without raising a DOM security exception.
192 bool cookie_enabled;
194 // This flag indicates whether H/W accelerated video decode is enabled for
195 // pepper plugins. Defaults to false.
196 bool pepper_accelerated_video_decode_enabled;
198 ImageAnimationPolicy animation_policy;
200 #if defined(OS_ANDROID)
201 bool text_autosizing_enabled;
202 float font_scale_factor;
203 float device_scale_adjustment;
204 bool force_enable_zoom;
205 bool fullscreen_supported;
206 bool double_tap_to_zoom_enabled;
207 bool user_gesture_required_for_media_playback;
208 GURL default_video_poster_url;
209 bool support_deprecated_target_density_dpi;
210 bool use_legacy_background_size_shorthand_behavior;
211 bool wide_viewport_quirk;
212 bool use_wide_viewport;
213 bool force_zero_layout_height;
214 bool viewport_meta_layout_size_quirk;
215 bool viewport_meta_merge_content_quirk;
216 bool viewport_meta_non_user_scalable_quirk;
217 bool viewport_meta_zero_values_quirk;
218 bool clobber_user_agent_initial_scale_quirk;
219 bool ignore_main_frame_overflow_hidden_quirk;
220 bool report_screen_size_in_physical_pixels_quirk;
221 #endif
223 // Default (used if the page or UA doesn't override these) values for page
224 // scale limits. These are set directly on the WebView so there's no analogue
225 // in WebSettings.
226 float default_minimum_page_scale_factor;
227 float default_maximum_page_scale_factor;
229 // We try to keep the default values the same as the default values in
230 // chrome, except for the cases where it would require lots of extra work for
231 // the embedder to use the same default value.
232 WebPreferences();
233 ~WebPreferences();
236 } // namespace content
238 #endif // CONTENT_PUBLIC_COMMON_WEB_PREFERENCES_H_