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

Side by Side Diff: Source/core/html/HTMLMediaElement.cpp

Issue 23440027: Added a new runtime setting for RequireUserGestureForFullscreenRestriction. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 , m_networkState(NETWORK_EMPTY) 251 , m_networkState(NETWORK_EMPTY)
252 , m_readyState(HAVE_NOTHING) 252 , m_readyState(HAVE_NOTHING)
253 , m_readyStateMaximum(HAVE_NOTHING) 253 , m_readyStateMaximum(HAVE_NOTHING)
254 , m_volume(1.0f) 254 , m_volume(1.0f)
255 , m_lastSeekTime(0) 255 , m_lastSeekTime(0)
256 , m_previousProgressTime(numeric_limits<double>::max()) 256 , m_previousProgressTime(numeric_limits<double>::max())
257 , m_duration(numeric_limits<double>::quiet_NaN()) 257 , m_duration(numeric_limits<double>::quiet_NaN())
258 , m_lastTimeUpdateEventWallTime(0) 258 , m_lastTimeUpdateEventWallTime(0)
259 , m_lastTimeUpdateEventMovieTime(numeric_limits<double>::max()) 259 , m_lastTimeUpdateEventMovieTime(numeric_limits<double>::max())
260 , m_loadState(WaitingForSource) 260 , m_loadState(WaitingForSource)
261 , m_restrictions(RequireUserGestureForFullscreenRestriction | RequirePageCon sentToLoadMediaRestriction) 261 , m_restrictions(RequirePageConsentToLoadMediaRestriction)
262 , m_preload(MediaPlayer::Auto) 262 , m_preload(MediaPlayer::Auto)
263 , m_displayMode(Unknown) 263 , m_displayMode(Unknown)
264 , m_cachedTime(MediaPlayer::invalidTime()) 264 , m_cachedTime(MediaPlayer::invalidTime())
265 , m_cachedTimeWallClockUpdateTime(0) 265 , m_cachedTimeWallClockUpdateTime(0)
266 , m_minimumWallClockTimeToCacheMediaTime(0) 266 , m_minimumWallClockTimeToCacheMediaTime(0)
267 , m_fragmentStartTime(MediaPlayer::invalidTime()) 267 , m_fragmentStartTime(MediaPlayer::invalidTime())
268 , m_fragmentEndTime(MediaPlayer::invalidTime()) 268 , m_fragmentEndTime(MediaPlayer::invalidTime())
269 , m_pendingActionFlags(0) 269 , m_pendingActionFlags(0)
270 , m_playing(false) 270 , m_playing(false)
271 , m_shouldDelayLoadEvent(false) 271 , m_shouldDelayLoadEvent(false)
(...skipping 21 matching lines...) Expand all
293 , m_ignoreTrackDisplayUpdate(0) 293 , m_ignoreTrackDisplayUpdate(0)
294 #if ENABLE(WEB_AUDIO) 294 #if ENABLE(WEB_AUDIO)
295 , m_audioSourceNode(0) 295 , m_audioSourceNode(0)
296 #endif 296 #endif
297 { 297 {
298 ASSERT(RuntimeEnabledFeatures::mediaEnabled()); 298 ASSERT(RuntimeEnabledFeatures::mediaEnabled());
299 299
300 LOG(Media, "HTMLMediaElement::HTMLMediaElement"); 300 LOG(Media, "HTMLMediaElement::HTMLMediaElement");
301 ScriptWrappable::init(this); 301 ScriptWrappable::init(this);
302 302
303 if (document.settings() && document.settings()->mediaPlaybackRequiresUserGes ture()) { 303 if (document.settings()) {
304 addBehaviorRestriction(RequireUserGestureForRateChangeRestriction); 304 if (document.settings()->mediaPlaybackRequiresUserGesture()) {
305 addBehaviorRestriction(RequireUserGestureForLoadRestriction); 305 addBehaviorRestriction(RequireUserGestureForRateChangeRestriction);
306 addBehaviorRestriction(RequireUserGestureForLoadRestriction);
307 }
308 if (document.settings()->mediaFullscreenRequiresUserGesture()) {
309 addBehaviorRestriction(RequireUserGestureForFullscreenRestriction);
310 }
306 } 311 }
307 312
308 setHasCustomStyleCallbacks(); 313 setHasCustomStyleCallbacks();
309 addElementToDocumentMap(this, &document); 314 addElementToDocumentMap(this, &document);
310 315
311 } 316 }
312 317
313 HTMLMediaElement::~HTMLMediaElement() 318 HTMLMediaElement::~HTMLMediaElement()
314 { 319 {
315 LOG(Media, "HTMLMediaElement::~HTMLMediaElement"); 320 LOG(Media, "HTMLMediaElement::~HTMLMediaElement");
(...skipping 3666 matching lines...) Expand 10 before | Expand all | Expand 10 after
3982 { 3987 {
3983 m_restrictions = NoRestrictions; 3988 m_restrictions = NoRestrictions;
3984 } 3989 }
3985 3990
3986 void HTMLMediaElement::mediaPlayerScheduleLayerUpdate() 3991 void HTMLMediaElement::mediaPlayerScheduleLayerUpdate()
3987 { 3992 {
3988 scheduleLayerUpdate(); 3993 scheduleLayerUpdate();
3989 } 3994 }
3990 3995
3991 } 3996 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698