[Android] Implement 3-way sensor fallback for Device Orientation.
[chromium-blink-merge.git] / content / public / common / common_param_traits_macros.h
blob119fc1d6fa65bb69ba5e4bbb8482a3bbe7811ae9
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 // Singly or Multiply-included shared traits file depending on circumstances.
6 // This allows the use of IPC serialization macros in more than one IPC message
7 // file.
8 #ifndef CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_
9 #define CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_
11 #include "content/public/common/console_message_level.h"
12 #include "content/public/common/referrer.h"
13 #include "content/public/common/security_style.h"
14 #include "content/public/common/ssl_status.h"
15 #include "content/public/common/web_preferences.h"
16 #include "content/public/common/webplugininfo.h"
17 #include "ipc/ipc_message_macros.h"
18 #include "net/base/network_change_notifier.h"
19 #include "net/base/request_priority.h"
20 #include "third_party/WebKit/public/platform/WebPoint.h"
21 #include "third_party/WebKit/public/platform/WebRect.h"
22 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h"
23 #include "third_party/WebKit/public/platform/WebURLRequest.h"
24 #include "third_party/WebKit/public/web/WebWindowFeatures.h"
25 #include "ui/accessibility/ax_node_data.h"
26 #include "ui/accessibility/ax_tree_update.h"
27 #include "ui/base/page_transition_types.h"
28 #include "ui/base/window_open_disposition.h"
29 #include "ui/gfx/ipc/gfx_param_traits.h"
31 #undef IPC_MESSAGE_EXPORT
32 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
34 IPC_ENUM_TRAITS_VALIDATE(ui::PageTransition,
35 ((value &
36 ui::PageTransition::PAGE_TRANSITION_CORE_MASK) <=
37 ui::PageTransition::PAGE_TRANSITION_LAST_CORE))
38 IPC_ENUM_TRAITS_MAX_VALUE(net::NetworkChangeNotifier::ConnectionType,
39 net::NetworkChangeNotifier::CONNECTION_LAST)
40 IPC_ENUM_TRAITS_MAX_VALUE(content::ConsoleMessageLevel,
41 content::CONSOLE_MESSAGE_LEVEL_LAST)
42 IPC_ENUM_TRAITS_MAX_VALUE(content::SecurityStyle,
43 content::SECURITY_STYLE_LAST)
44 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebReferrerPolicy,
45 blink::WebReferrerPolicyLast)
46 IPC_ENUM_TRAITS_MAX_VALUE(content::EditingBehavior,
47 content::EDITING_BEHAVIOR_LAST)
48 IPC_ENUM_TRAITS_MAX_VALUE(WindowOpenDisposition,
49 WINDOW_OPEN_DISPOSITION_LAST)
50 IPC_ENUM_TRAITS_MAX_VALUE(net::RequestPriority, net::MAXIMUM_PRIORITY)
51 IPC_ENUM_TRAITS_MAX_VALUE(content::V8CacheOptions,
52 content::V8_CACHE_OPTIONS_LAST)
53 IPC_ENUM_TRAITS_MIN_MAX_VALUE(ui::PointerType,
54 ui::POINTER_TYPE_FIRST,
55 ui::POINTER_TYPE_LAST)
56 IPC_ENUM_TRAITS_MIN_MAX_VALUE(ui::HoverType,
57 ui::HOVER_TYPE_FIRST,
58 ui::HOVER_TYPE_LAST)
59 IPC_ENUM_TRAITS_MIN_MAX_VALUE(content::ImageAnimationPolicy,
60 content::IMAGE_ANIMATION_POLICY_ALLOWED,
61 content::IMAGE_ANIMATION_POLICY_NO_ANIMATION)
63 IPC_STRUCT_TRAITS_BEGIN(blink::WebPoint)
64 IPC_STRUCT_TRAITS_MEMBER(x)
65 IPC_STRUCT_TRAITS_MEMBER(y)
66 IPC_STRUCT_TRAITS_END()
68 IPC_STRUCT_TRAITS_BEGIN(blink::WebRect)
69 IPC_STRUCT_TRAITS_MEMBER(x)
70 IPC_STRUCT_TRAITS_MEMBER(y)
71 IPC_STRUCT_TRAITS_MEMBER(width)
72 IPC_STRUCT_TRAITS_MEMBER(height)
73 IPC_STRUCT_TRAITS_END()
75 IPC_STRUCT_TRAITS_BEGIN(content::Referrer)
76 IPC_STRUCT_TRAITS_MEMBER(url)
77 IPC_STRUCT_TRAITS_MEMBER(policy)
78 IPC_STRUCT_TRAITS_END()
80 IPC_STRUCT_TRAITS_BEGIN(content::SSLStatus)
81 IPC_STRUCT_TRAITS_MEMBER(security_style)
82 IPC_STRUCT_TRAITS_MEMBER(cert_id)
83 IPC_STRUCT_TRAITS_MEMBER(cert_status)
84 IPC_STRUCT_TRAITS_MEMBER(security_bits)
85 IPC_STRUCT_TRAITS_MEMBER(connection_status)
86 IPC_STRUCT_TRAITS_MEMBER(content_status)
87 IPC_STRUCT_TRAITS_END()
89 IPC_STRUCT_TRAITS_BEGIN(content::WebPluginMimeType)
90 IPC_STRUCT_TRAITS_MEMBER(mime_type)
91 IPC_STRUCT_TRAITS_MEMBER(file_extensions)
92 IPC_STRUCT_TRAITS_MEMBER(description)
93 IPC_STRUCT_TRAITS_MEMBER(additional_param_names)
94 IPC_STRUCT_TRAITS_MEMBER(additional_param_values)
95 IPC_STRUCT_TRAITS_END()
97 IPC_STRUCT_TRAITS_BEGIN(content::WebPluginInfo)
98 IPC_STRUCT_TRAITS_MEMBER(name)
99 IPC_STRUCT_TRAITS_MEMBER(path)
100 IPC_STRUCT_TRAITS_MEMBER(version)
101 IPC_STRUCT_TRAITS_MEMBER(desc)
102 IPC_STRUCT_TRAITS_MEMBER(mime_types)
103 IPC_STRUCT_TRAITS_MEMBER(type)
104 IPC_STRUCT_TRAITS_MEMBER(pepper_permissions)
105 IPC_STRUCT_TRAITS_END()
107 IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
108 IPC_STRUCT_TRAITS_MEMBER(standard_font_family_map)
109 IPC_STRUCT_TRAITS_MEMBER(fixed_font_family_map)
110 IPC_STRUCT_TRAITS_MEMBER(serif_font_family_map)
111 IPC_STRUCT_TRAITS_MEMBER(sans_serif_font_family_map)
112 IPC_STRUCT_TRAITS_MEMBER(cursive_font_family_map)
113 IPC_STRUCT_TRAITS_MEMBER(fantasy_font_family_map)
114 IPC_STRUCT_TRAITS_MEMBER(default_font_size)
115 IPC_STRUCT_TRAITS_MEMBER(default_fixed_font_size)
116 IPC_STRUCT_TRAITS_MEMBER(minimum_font_size)
117 IPC_STRUCT_TRAITS_MEMBER(minimum_logical_font_size)
118 IPC_STRUCT_TRAITS_MEMBER(default_encoding)
119 IPC_STRUCT_TRAITS_MEMBER(context_menu_on_mouse_up)
120 IPC_STRUCT_TRAITS_MEMBER(javascript_enabled)
121 IPC_STRUCT_TRAITS_MEMBER(web_security_enabled)
122 IPC_STRUCT_TRAITS_MEMBER(javascript_can_open_windows_automatically)
123 IPC_STRUCT_TRAITS_MEMBER(loads_images_automatically)
124 IPC_STRUCT_TRAITS_MEMBER(images_enabled)
125 IPC_STRUCT_TRAITS_MEMBER(plugins_enabled)
126 IPC_STRUCT_TRAITS_MEMBER(dom_paste_enabled)
127 IPC_STRUCT_TRAITS_MEMBER(shrinks_standalone_images_to_fit)
128 IPC_STRUCT_TRAITS_MEMBER(uses_universal_detector)
129 IPC_STRUCT_TRAITS_MEMBER(text_areas_are_resizable)
130 IPC_STRUCT_TRAITS_MEMBER(java_enabled)
131 IPC_STRUCT_TRAITS_MEMBER(allow_scripts_to_close_windows)
132 IPC_STRUCT_TRAITS_MEMBER(remote_fonts_enabled)
133 IPC_STRUCT_TRAITS_MEMBER(javascript_can_access_clipboard)
134 IPC_STRUCT_TRAITS_MEMBER(xslt_enabled)
135 IPC_STRUCT_TRAITS_MEMBER(xss_auditor_enabled)
136 IPC_STRUCT_TRAITS_MEMBER(dns_prefetching_enabled)
137 IPC_STRUCT_TRAITS_MEMBER(local_storage_enabled)
138 IPC_STRUCT_TRAITS_MEMBER(databases_enabled)
139 IPC_STRUCT_TRAITS_MEMBER(application_cache_enabled)
140 IPC_STRUCT_TRAITS_MEMBER(tabs_to_links)
141 IPC_STRUCT_TRAITS_MEMBER(hyperlink_auditing_enabled)
142 IPC_STRUCT_TRAITS_MEMBER(is_online)
143 IPC_STRUCT_TRAITS_MEMBER(connection_type)
144 IPC_STRUCT_TRAITS_MEMBER(allow_universal_access_from_file_urls)
145 IPC_STRUCT_TRAITS_MEMBER(allow_file_access_from_file_urls)
146 IPC_STRUCT_TRAITS_MEMBER(webaudio_enabled)
147 IPC_STRUCT_TRAITS_MEMBER(experimental_webgl_enabled)
148 IPC_STRUCT_TRAITS_MEMBER(pepper_3d_enabled)
149 IPC_STRUCT_TRAITS_MEMBER(invert_viewport_scroll_order)
150 IPC_STRUCT_TRAITS_MEMBER(pinch_overlay_scrollbar_thickness)
151 IPC_STRUCT_TRAITS_MEMBER(use_solid_color_scrollbars)
152 IPC_STRUCT_TRAITS_MEMBER(flash_3d_enabled)
153 IPC_STRUCT_TRAITS_MEMBER(flash_stage3d_enabled)
154 IPC_STRUCT_TRAITS_MEMBER(flash_stage3d_baseline_enabled)
155 IPC_STRUCT_TRAITS_MEMBER(gl_multisampling_enabled)
156 IPC_STRUCT_TRAITS_MEMBER(privileged_webgl_extensions_enabled)
157 IPC_STRUCT_TRAITS_MEMBER(webgl_errors_to_console_enabled)
158 IPC_STRUCT_TRAITS_MEMBER(mock_scrollbars_enabled)
159 IPC_STRUCT_TRAITS_MEMBER(asynchronous_spell_checking_enabled)
160 IPC_STRUCT_TRAITS_MEMBER(unified_textchecker_enabled)
161 IPC_STRUCT_TRAITS_MEMBER(accelerated_2d_canvas_enabled)
162 IPC_STRUCT_TRAITS_MEMBER(minimum_accelerated_2d_canvas_size)
163 IPC_STRUCT_TRAITS_MEMBER(antialiased_2d_canvas_disabled)
164 IPC_STRUCT_TRAITS_MEMBER(antialiased_clips_2d_canvas_enabled)
165 IPC_STRUCT_TRAITS_MEMBER(accelerated_2d_canvas_msaa_sample_count)
166 IPC_STRUCT_TRAITS_MEMBER(accelerated_filters_enabled)
167 IPC_STRUCT_TRAITS_MEMBER(deferred_filters_enabled)
168 IPC_STRUCT_TRAITS_MEMBER(container_culling_enabled)
169 IPC_STRUCT_TRAITS_MEMBER(allow_displaying_insecure_content)
170 IPC_STRUCT_TRAITS_MEMBER(allow_running_insecure_content)
171 IPC_STRUCT_TRAITS_MEMBER(disable_reading_from_canvas)
172 IPC_STRUCT_TRAITS_MEMBER(strict_mixed_content_checking)
173 IPC_STRUCT_TRAITS_MEMBER(strict_powerful_feature_restrictions)
174 IPC_STRUCT_TRAITS_MEMBER(strictly_block_blockable_mixed_content)
175 IPC_STRUCT_TRAITS_MEMBER(block_mixed_plugin_content)
176 IPC_STRUCT_TRAITS_MEMBER(enable_scroll_animator)
177 IPC_STRUCT_TRAITS_MEMBER(password_echo_enabled)
178 IPC_STRUCT_TRAITS_MEMBER(should_clear_document_background)
179 IPC_STRUCT_TRAITS_MEMBER(touch_enabled)
180 IPC_STRUCT_TRAITS_MEMBER(device_supports_touch)
181 IPC_STRUCT_TRAITS_MEMBER(device_supports_mouse)
182 IPC_STRUCT_TRAITS_MEMBER(touch_adjustment_enabled)
183 IPC_STRUCT_TRAITS_MEMBER(pointer_events_max_touch_points)
184 IPC_STRUCT_TRAITS_MEMBER(available_pointer_types)
185 IPC_STRUCT_TRAITS_MEMBER(primary_pointer_type)
186 IPC_STRUCT_TRAITS_MEMBER(available_hover_types)
187 IPC_STRUCT_TRAITS_MEMBER(primary_hover_type)
188 IPC_STRUCT_TRAITS_MEMBER(sync_xhr_in_documents_enabled)
189 IPC_STRUCT_TRAITS_MEMBER(image_color_profiles_enabled)
190 IPC_STRUCT_TRAITS_MEMBER(should_respect_image_orientation)
191 IPC_STRUCT_TRAITS_MEMBER(number_of_cpu_cores)
192 IPC_STRUCT_TRAITS_MEMBER(editing_behavior)
193 IPC_STRUCT_TRAITS_MEMBER(supports_multiple_windows)
194 IPC_STRUCT_TRAITS_MEMBER(viewport_enabled)
195 IPC_STRUCT_TRAITS_MEMBER(viewport_meta_enabled)
196 IPC_STRUCT_TRAITS_MEMBER(main_frame_resizes_are_orientation_changes)
197 IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale)
198 IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled)
199 IPC_STRUCT_TRAITS_MEMBER(cookie_enabled)
200 IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop)
201 IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled)
202 IPC_STRUCT_TRAITS_MEMBER(v8_cache_options)
203 IPC_STRUCT_TRAITS_MEMBER(slimming_paint_enabled)
204 IPC_STRUCT_TRAITS_MEMBER(slimming_paint_v2_enabled)
205 IPC_STRUCT_TRAITS_MEMBER(pepper_accelerated_video_decode_enabled)
206 IPC_STRUCT_TRAITS_MEMBER(animation_policy)
207 #if defined(OS_ANDROID)
208 IPC_STRUCT_TRAITS_MEMBER(text_autosizing_enabled)
209 IPC_STRUCT_TRAITS_MEMBER(font_scale_factor)
210 IPC_STRUCT_TRAITS_MEMBER(device_scale_adjustment)
211 IPC_STRUCT_TRAITS_MEMBER(force_enable_zoom)
212 IPC_STRUCT_TRAITS_MEMBER(fullscreen_supported)
213 IPC_STRUCT_TRAITS_MEMBER(double_tap_to_zoom_enabled)
214 IPC_STRUCT_TRAITS_MEMBER(user_gesture_required_for_media_playback)
215 IPC_STRUCT_TRAITS_MEMBER(default_video_poster_url)
216 IPC_STRUCT_TRAITS_MEMBER(support_deprecated_target_density_dpi)
217 IPC_STRUCT_TRAITS_MEMBER(use_legacy_background_size_shorthand_behavior)
218 IPC_STRUCT_TRAITS_MEMBER(wide_viewport_quirk)
219 IPC_STRUCT_TRAITS_MEMBER(use_wide_viewport)
220 IPC_STRUCT_TRAITS_MEMBER(force_zero_layout_height)
221 IPC_STRUCT_TRAITS_MEMBER(viewport_meta_layout_size_quirk)
222 IPC_STRUCT_TRAITS_MEMBER(viewport_meta_merge_content_quirk)
223 IPC_STRUCT_TRAITS_MEMBER(viewport_meta_non_user_scalable_quirk)
224 IPC_STRUCT_TRAITS_MEMBER(viewport_meta_zero_values_quirk)
225 IPC_STRUCT_TRAITS_MEMBER(clobber_user_agent_initial_scale_quirk)
226 IPC_STRUCT_TRAITS_MEMBER(ignore_main_frame_overflow_hidden_quirk)
227 IPC_STRUCT_TRAITS_MEMBER(report_screen_size_in_physical_pixels_quirk)
228 #endif
229 IPC_STRUCT_TRAITS_MEMBER(default_minimum_page_scale_factor)
230 IPC_STRUCT_TRAITS_MEMBER(default_maximum_page_scale_factor)
231 IPC_STRUCT_TRAITS_END()
233 IPC_STRUCT_TRAITS_BEGIN(blink::WebWindowFeatures)
234 IPC_STRUCT_TRAITS_MEMBER(x)
235 IPC_STRUCT_TRAITS_MEMBER(xSet)
236 IPC_STRUCT_TRAITS_MEMBER(y)
237 IPC_STRUCT_TRAITS_MEMBER(ySet)
238 IPC_STRUCT_TRAITS_MEMBER(width)
239 IPC_STRUCT_TRAITS_MEMBER(widthSet)
240 IPC_STRUCT_TRAITS_MEMBER(height)
241 IPC_STRUCT_TRAITS_MEMBER(heightSet)
242 IPC_STRUCT_TRAITS_MEMBER(menuBarVisible)
243 IPC_STRUCT_TRAITS_MEMBER(statusBarVisible)
244 IPC_STRUCT_TRAITS_MEMBER(toolBarVisible)
245 IPC_STRUCT_TRAITS_MEMBER(locationBarVisible)
246 IPC_STRUCT_TRAITS_MEMBER(scrollbarsVisible)
247 IPC_STRUCT_TRAITS_MEMBER(resizable)
248 IPC_STRUCT_TRAITS_MEMBER(fullscreen)
249 IPC_STRUCT_TRAITS_MEMBER(dialog)
250 IPC_STRUCT_TRAITS_END()
252 IPC_ENUM_TRAITS_MAX_VALUE(ui::AXEvent, ui::AX_EVENT_LAST)
253 IPC_ENUM_TRAITS_MAX_VALUE(ui::AXRole, ui::AX_ROLE_LAST)
254 IPC_ENUM_TRAITS_MAX_VALUE(ui::AXBoolAttribute, ui::AX_BOOL_ATTRIBUTE_LAST)
255 IPC_ENUM_TRAITS_MAX_VALUE(ui::AXFloatAttribute, ui::AX_FLOAT_ATTRIBUTE_LAST)
256 IPC_ENUM_TRAITS_MAX_VALUE(ui::AXIntAttribute, ui::AX_INT_ATTRIBUTE_LAST)
257 IPC_ENUM_TRAITS_MAX_VALUE(ui::AXIntListAttribute,
258 ui::AX_INT_LIST_ATTRIBUTE_LAST)
259 IPC_ENUM_TRAITS_MAX_VALUE(ui::AXStringAttribute, ui::AX_STRING_ATTRIBUTE_LAST)
261 #endif // CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_