OLD | NEW |
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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 , m_emeMode(EmeModeNotSelected) | 310 , m_emeMode(EmeModeNotSelected) |
311 { | 311 { |
312 ASSERT(RuntimeEnabledFeatures::mediaEnabled()); | 312 ASSERT(RuntimeEnabledFeatures::mediaEnabled()); |
313 | 313 |
314 WTF_LOG(Media, "HTMLMediaElement::HTMLMediaElement"); | 314 WTF_LOG(Media, "HTMLMediaElement::HTMLMediaElement"); |
315 ScriptWrappable::init(this); | 315 ScriptWrappable::init(this); |
316 | 316 |
317 if (document.settings()) { | 317 if (document.settings()) { |
318 if (document.settings()->mediaPlaybackRequiresUserGesture()) | 318 if (document.settings()->mediaPlaybackRequiresUserGesture()) |
319 addBehaviorRestriction(RequireUserGestureForPlayRestriction); | 319 addBehaviorRestriction(RequireUserGestureForPlayRestriction); |
320 if (document.settings()->mediaFullscreenRequiresUserGesture()) | |
321 addBehaviorRestriction(RequireUserGestureForFullscreenRestriction); | |
322 } | 320 } |
323 | 321 |
324 // We must always have a ShadowRoot so children like <source> will not rende
r | 322 // We must always have a ShadowRoot so children like <source> will not rende
r |
325 // as they never have an insertion point. | 323 // as they never have an insertion point. |
326 ensureUserAgentShadowRoot(); | 324 ensureUserAgentShadowRoot(); |
327 setHasCustomStyleCallbacks(); | 325 setHasCustomStyleCallbacks(); |
328 addElementToDocumentMap(this, &document); | 326 addElementToDocumentMap(this, &document); |
329 } | 327 } |
330 | 328 |
331 HTMLMediaElement::~HTMLMediaElement() | 329 HTMLMediaElement::~HTMLMediaElement() |
(...skipping 3118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3450 } | 3448 } |
3451 | 3449 |
3452 void HTMLMediaElement::enterFullscreen() | 3450 void HTMLMediaElement::enterFullscreen() |
3453 { | 3451 { |
3454 WTF_LOG(Media, "HTMLMediaElement::enterFullscreen"); | 3452 WTF_LOG(Media, "HTMLMediaElement::enterFullscreen"); |
3455 | 3453 |
3456 if (document().settings() && document().settings()->fullScreenEnabled()) | 3454 if (document().settings() && document().settings()->fullScreenEnabled()) |
3457 FullscreenElementStack::from(document()).requestFullScreenForElement(thi
s, 0, FullscreenElementStack::ExemptIFrameAllowFullScreenRequirement); | 3455 FullscreenElementStack::from(document()).requestFullScreenForElement(thi
s, 0, FullscreenElementStack::ExemptIFrameAllowFullScreenRequirement); |
3458 } | 3456 } |
3459 | 3457 |
3460 void HTMLMediaElement::exitFullscreen() | |
3461 { | |
3462 WTF_LOG(Media, "HTMLMediaElement::exitFullscreen"); | |
3463 | |
3464 if (document().settings() && document().settings()->fullScreenEnabled() && i
sFullscreen()) | |
3465 FullscreenElementStack::from(document()).webkitCancelFullScreen(); | |
3466 } | |
3467 | |
3468 void HTMLMediaElement::didBecomeFullscreenElement() | 3458 void HTMLMediaElement::didBecomeFullscreenElement() |
3469 { | 3459 { |
3470 if (hasMediaControls()) | 3460 if (hasMediaControls()) |
3471 mediaControls()->enteredFullscreen(); | 3461 mediaControls()->enteredFullscreen(); |
3472 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && isVideo()) | 3462 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && isVideo()) |
3473 document().renderView()->compositor()->setCompositingLayersNeedRebuild(t
rue); | 3463 document().renderView()->compositor()->setCompositingLayersNeedRebuild(t
rue); |
3474 } | 3464 } |
3475 | 3465 |
3476 void HTMLMediaElement::willStopBeingFullscreenElement() | 3466 void HTMLMediaElement::willStopBeingFullscreenElement() |
3477 { | 3467 { |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3917 { | 3907 { |
3918 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); | 3908 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); |
3919 } | 3909 } |
3920 | 3910 |
3921 bool HTMLMediaElement::isInteractiveContent() const | 3911 bool HTMLMediaElement::isInteractiveContent() const |
3922 { | 3912 { |
3923 return fastHasAttribute(controlsAttr); | 3913 return fastHasAttribute(controlsAttr); |
3924 } | 3914 } |
3925 | 3915 |
3926 } | 3916 } |
OLD | NEW |