OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_PUBLIC_COMMON_WEB_PREFERENCES_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_WEB_PREFERENCES_H_ |
6 #define CONTENT_PUBLIC_COMMON_WEB_PREFERENCES_H_ | 6 #define CONTENT_PUBLIC_COMMON_WEB_PREFERENCES_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // third_party/WebKit/Source/core/loader/ProgressTracker.cpp for most of its | 59 // third_party/WebKit/Source/core/loader/ProgressTracker.cpp for most of its |
60 // effects. | 60 // effects. |
61 enum class ProgressBarCompletion { | 61 enum class ProgressBarCompletion { |
62 LOAD_EVENT, | 62 LOAD_EVENT, |
63 RESOURCES_BEFORE_DCL, | 63 RESOURCES_BEFORE_DCL, |
64 DOM_CONTENT_LOADED, | 64 DOM_CONTENT_LOADED, |
65 RESOURCES_BEFORE_DCL_AND_SAME_ORIGIN_IFRAMES, | 65 RESOURCES_BEFORE_DCL_AND_SAME_ORIGIN_IFRAMES, |
66 LAST = RESOURCES_BEFORE_DCL_AND_SAME_ORIGIN_IFRAMES | 66 LAST = RESOURCES_BEFORE_DCL_AND_SAME_ORIGIN_IFRAMES |
67 }; | 67 }; |
68 | 68 |
| 69 // Defines the autoplay policy to be used. Should match the class in |
| 70 // WebSettings.h. |
| 71 enum class AutoplayPolicy { |
| 72 kNoUserGestureRequired, |
| 73 kUserGestureRequired, |
| 74 kUserGestureRequiredForCrossOrigin, |
| 75 }; |
| 76 |
69 // The ISO 15924 script code for undetermined script aka Common. It's the | 77 // The ISO 15924 script code for undetermined script aka Common. It's the |
70 // default used on WebKit's side to get/set a font setting when no script is | 78 // default used on WebKit's side to get/set a font setting when no script is |
71 // specified. | 79 // specified. |
72 CONTENT_EXPORT extern const char kCommonScript[]; | 80 CONTENT_EXPORT extern const char kCommonScript[]; |
73 | 81 |
74 // A struct for managing blink's settings. | 82 // A struct for managing blink's settings. |
75 // | 83 // |
76 // Adding new values to this class probably involves updating | 84 // Adding new values to this class probably involves updating |
77 // blink::WebSettings, content/common/view_messages.h, browser/tab_contents/ | 85 // blink::WebSettings, content/common/view_messages.h, browser/tab_contents/ |
78 // render_view_host_delegate_helper.cc, browser/profiles/profile.cc, | 86 // render_view_host_delegate_helper.cc, browser/profiles/profile.cc, |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 float expensive_background_throttling_max_budget; | 224 float expensive_background_throttling_max_budget; |
217 float expensive_background_throttling_max_delay; | 225 float expensive_background_throttling_max_delay; |
218 | 226 |
219 #if defined(OS_ANDROID) | 227 #if defined(OS_ANDROID) |
220 bool text_autosizing_enabled; | 228 bool text_autosizing_enabled; |
221 float font_scale_factor; | 229 float font_scale_factor; |
222 float device_scale_adjustment; | 230 float device_scale_adjustment; |
223 bool force_enable_zoom; | 231 bool force_enable_zoom; |
224 bool fullscreen_supported; | 232 bool fullscreen_supported; |
225 bool double_tap_to_zoom_enabled; | 233 bool double_tap_to_zoom_enabled; |
226 bool user_gesture_required_for_media_playback; | |
227 std::string media_playback_gesture_whitelist_scope; | 234 std::string media_playback_gesture_whitelist_scope; |
228 GURL default_video_poster_url; | 235 GURL default_video_poster_url; |
229 bool support_deprecated_target_density_dpi; | 236 bool support_deprecated_target_density_dpi; |
230 bool use_legacy_background_size_shorthand_behavior; | 237 bool use_legacy_background_size_shorthand_behavior; |
231 bool wide_viewport_quirk; | 238 bool wide_viewport_quirk; |
232 bool use_wide_viewport; | 239 bool use_wide_viewport; |
233 bool force_zero_layout_height; | 240 bool force_zero_layout_height; |
234 bool viewport_meta_layout_size_quirk; | 241 bool viewport_meta_layout_size_quirk; |
235 bool viewport_meta_merge_content_quirk; | 242 bool viewport_meta_merge_content_quirk; |
236 bool viewport_meta_non_user_scalable_quirk; | 243 bool viewport_meta_non_user_scalable_quirk; |
(...skipping 10 matching lines...) Expand all Loading... |
247 bool spellcheck_enabled_by_default; | 254 bool spellcheck_enabled_by_default; |
248 // If enabled, when a video goes fullscreen, the orientation should be locked. | 255 // If enabled, when a video goes fullscreen, the orientation should be locked. |
249 bool video_fullscreen_orientation_lock_enabled; | 256 bool video_fullscreen_orientation_lock_enabled; |
250 // If enabled, fullscreen should be entered/exited when the device is rotated | 257 // If enabled, fullscreen should be entered/exited when the device is rotated |
251 // to/from the orientation of the video. | 258 // to/from the orientation of the video. |
252 bool video_rotate_to_fullscreen_enabled; | 259 bool video_rotate_to_fullscreen_enabled; |
253 // If enabled, video fullscreen detection will be enabled. | 260 // If enabled, video fullscreen detection will be enabled. |
254 bool video_fullscreen_detection_enabled; | 261 bool video_fullscreen_detection_enabled; |
255 bool embedded_media_experience_enabled; | 262 bool embedded_media_experience_enabled; |
256 #else // defined(OS_ANDROID) | 263 #else // defined(OS_ANDROID) |
257 bool cross_origin_media_playback_requires_user_gesture; | |
258 #endif // defined(OS_ANDROID) | 264 #endif // defined(OS_ANDROID) |
259 | 265 |
260 // Default (used if the page or UA doesn't override these) values for page | 266 // Default (used if the page or UA doesn't override these) values for page |
261 // scale limits. These are set directly on the WebView so there's no analogue | 267 // scale limits. These are set directly on the WebView so there's no analogue |
262 // in WebSettings. | 268 // in WebSettings. |
263 float default_minimum_page_scale_factor; | 269 float default_minimum_page_scale_factor; |
264 float default_maximum_page_scale_factor; | 270 float default_maximum_page_scale_factor; |
265 | 271 |
266 // Whether download UI should be hidden on this page. | 272 // Whether download UI should be hidden on this page. |
267 bool hide_download_ui; | 273 bool hide_download_ui; |
(...skipping 14 matching lines...) Expand all Loading... |
282 | 288 |
283 // If disabled, media controls should never be used. | 289 // If disabled, media controls should never be used. |
284 bool media_controls_enabled; | 290 bool media_controls_enabled; |
285 | 291 |
286 // Whether we want to disable updating selection on mutating selection range. | 292 // Whether we want to disable updating selection on mutating selection range. |
287 // This is to work around Samsung's email app issue. See | 293 // This is to work around Samsung's email app issue. See |
288 // https://crbug.com/699943 for details. | 294 // https://crbug.com/699943 for details. |
289 // TODO(changwan): remove this once we no longer support Android N. | 295 // TODO(changwan): remove this once we no longer support Android N. |
290 bool do_not_update_selection_on_mutating_selection_range; | 296 bool do_not_update_selection_on_mutating_selection_range; |
291 | 297 |
| 298 // Defines the current autoplay policy. |
| 299 AutoplayPolicy autoplay_policy; |
| 300 |
292 // We try to keep the default values the same as the default values in | 301 // We try to keep the default values the same as the default values in |
293 // chrome, except for the cases where it would require lots of extra work for | 302 // chrome, except for the cases where it would require lots of extra work for |
294 // the embedder to use the same default value. | 303 // the embedder to use the same default value. |
295 WebPreferences(); | 304 WebPreferences(); |
296 WebPreferences(const WebPreferences& other); | 305 WebPreferences(const WebPreferences& other); |
297 ~WebPreferences(); | 306 ~WebPreferences(); |
298 }; | 307 }; |
299 | 308 |
300 } // namespace content | 309 } // namespace content |
301 | 310 |
302 #endif // CONTENT_PUBLIC_COMMON_WEB_PREFERENCES_H_ | 311 #endif // CONTENT_PUBLIC_COMMON_WEB_PREFERENCES_H_ |
OLD | NEW |