Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: content/public/common/web_preferences.h

Issue 2846623003: Make autoplay policies no longer platform dependant. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 {
nasko 2017/04/27 16:52:50 nit: MediaAutoplayPolicy?
72 kNoUserGestureRequired,
73 kCrossOriginUserGestureRequired,
74 kUserGestureRequired,
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
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;
237 bool viewport_meta_zero_values_quirk; 244 bool viewport_meta_zero_values_quirk;
238 bool clobber_user_agent_initial_scale_quirk; 245 bool clobber_user_agent_initial_scale_quirk;
239 bool ignore_main_frame_overflow_hidden_quirk; 246 bool ignore_main_frame_overflow_hidden_quirk;
240 bool report_screen_size_in_physical_pixels_quirk; 247 bool report_screen_size_in_physical_pixels_quirk;
241 // Used by Android_WebView only to support legacy apps that inject script into 248 // Used by Android_WebView only to support legacy apps that inject script into
242 // a top-level initial empty document and expect it to persist on navigation. 249 // a top-level initial empty document and expect it to persist on navigation.
243 bool resue_global_for_unowned_main_frame; 250 bool resue_global_for_unowned_main_frame;
244 ProgressBarCompletion progress_bar_completion; 251 ProgressBarCompletion progress_bar_completion;
245 // Specifies default setting for spellcheck when the spellcheck attribute is 252 // Specifies default setting for spellcheck when the spellcheck attribute is
246 // not explicitly specified. 253 // not explicitly specified.
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, video fullscreen detection will be enabled. 257 // If enabled, video fullscreen detection will be enabled.
251 bool video_fullscreen_detection_enabled; 258 bool video_fullscreen_detection_enabled;
252 bool embedded_media_experience_enabled; 259 bool embedded_media_experience_enabled;
253 #else // defined(OS_ANDROID) 260 #else // defined(OS_ANDROID)
254 bool cross_origin_media_playback_requires_user_gesture;
255 #endif // defined(OS_ANDROID) 261 #endif // defined(OS_ANDROID)
256 262
257 // Default (used if the page or UA doesn't override these) values for page 263 // Default (used if the page or UA doesn't override these) values for page
258 // scale limits. These are set directly on the WebView so there's no analogue 264 // scale limits. These are set directly on the WebView so there's no analogue
259 // in WebSettings. 265 // in WebSettings.
260 float default_minimum_page_scale_factor; 266 float default_minimum_page_scale_factor;
261 float default_maximum_page_scale_factor; 267 float default_maximum_page_scale_factor;
262 268
263 // Whether download UI should be hidden on this page. 269 // Whether download UI should be hidden on this page.
264 bool hide_download_ui; 270 bool hide_download_ui;
(...skipping 14 matching lines...) Expand all
279 285
280 // If disabled, media controls should never be used. 286 // If disabled, media controls should never be used.
281 bool media_controls_enabled; 287 bool media_controls_enabled;
282 288
283 // Whether we want to disable updating selection on mutating selection range. 289 // Whether we want to disable updating selection on mutating selection range.
284 // This is to work around Samsung's email app issue. See 290 // This is to work around Samsung's email app issue. See
285 // https://crbug.com/699943 for details. 291 // https://crbug.com/699943 for details.
286 // TODO(changwan): remove this once we no longer support Android N. 292 // TODO(changwan): remove this once we no longer support Android N.
287 bool do_not_update_selection_on_mutating_selection_range; 293 bool do_not_update_selection_on_mutating_selection_range;
288 294
295 // Defines the current autoplay policy.
296 AutoplayPolicy autoplay_policy;
297
289 // We try to keep the default values the same as the default values in 298 // We try to keep the default values the same as the default values in
290 // chrome, except for the cases where it would require lots of extra work for 299 // chrome, except for the cases where it would require lots of extra work for
291 // the embedder to use the same default value. 300 // the embedder to use the same default value.
292 WebPreferences(); 301 WebPreferences();
293 WebPreferences(const WebPreferences& other); 302 WebPreferences(const WebPreferences& other);
294 ~WebPreferences(); 303 ~WebPreferences();
295 }; 304 };
296 305
297 } // namespace content 306 } // namespace content
298 307
299 #endif // CONTENT_PUBLIC_COMMON_WEB_PREFERENCES_H_ 308 #endif // CONTENT_PUBLIC_COMMON_WEB_PREFERENCES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698