OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 m_ignorePreloadNone = false; | 659 m_ignorePreloadNone = false; |
660 invokeLoadAlgorithm(); | 660 invokeLoadAlgorithm(); |
661 } | 661 } |
662 } | 662 } |
663 | 663 |
664 return InsertionShouldCallDidNotifySubtreeInsertions; | 664 return InsertionShouldCallDidNotifySubtreeInsertions; |
665 } | 665 } |
666 | 666 |
667 void HTMLMediaElement::didNotifySubtreeInsertionsToDocument() { | 667 void HTMLMediaElement::didNotifySubtreeInsertionsToDocument() { |
668 updateControlsVisibility(); | 668 updateControlsVisibility(); |
| 669 |
| 670 if (document().settings() && |
| 671 document().settings()->getEmbeddedMediaExperienceEnabled()) { |
| 672 mediaControls()->makeTransparent(); |
| 673 } |
669 } | 674 } |
670 | 675 |
671 void HTMLMediaElement::removedFrom(ContainerNode* insertionPoint) { | 676 void HTMLMediaElement::removedFrom(ContainerNode* insertionPoint) { |
672 BLINK_MEDIA_LOG << "removedFrom(" << (void*)this << ", " << insertionPoint | 677 BLINK_MEDIA_LOG << "removedFrom(" << (void*)this << ", " << insertionPoint |
673 << ")"; | 678 << ")"; |
674 | 679 |
675 HTMLElement::removedFrom(insertionPoint); | 680 HTMLElement::removedFrom(insertionPoint); |
676 if (insertionPoint->inActiveDocument()) { | 681 if (insertionPoint->inActiveDocument()) { |
677 updateControlsVisibility(); | 682 updateControlsVisibility(); |
678 if (m_networkState > kNetworkEmpty) | 683 if (m_networkState > kNetworkEmpty) |
(...skipping 2865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3544 return false; | 3549 return false; |
3545 } | 3550 } |
3546 | 3551 |
3547 bool HTMLMediaElement::isFullscreen() const { | 3552 bool HTMLMediaElement::isFullscreen() const { |
3548 return Fullscreen::isCurrentFullScreenElement(*this); | 3553 return Fullscreen::isCurrentFullScreenElement(*this); |
3549 } | 3554 } |
3550 | 3555 |
3551 void HTMLMediaElement::didEnterFullscreen() { | 3556 void HTMLMediaElement::didEnterFullscreen() { |
3552 updateControlsVisibility(); | 3557 updateControlsVisibility(); |
3553 | 3558 |
| 3559 if (document().settings() && |
| 3560 document().settings()->getEmbeddedMediaExperienceEnabled()) { |
| 3561 mediaControls()->makeTransparent(); |
| 3562 } |
| 3563 |
3554 // FIXME: There is no embedder-side handling in layout test mode. | 3564 // FIXME: There is no embedder-side handling in layout test mode. |
3555 if (webMediaPlayer() && !LayoutTestSupport::isRunningLayoutTest()) | 3565 if (webMediaPlayer() && !LayoutTestSupport::isRunningLayoutTest()) |
3556 webMediaPlayer()->enteredFullscreen(); | 3566 webMediaPlayer()->enteredFullscreen(); |
3557 // Cache this in case the player is destroyed before leaving fullscreen. | 3567 // Cache this in case the player is destroyed before leaving fullscreen. |
3558 m_inOverlayFullscreenVideo = usesOverlayFullscreenVideo(); | 3568 m_inOverlayFullscreenVideo = usesOverlayFullscreenVideo(); |
3559 if (m_inOverlayFullscreenVideo) | 3569 if (m_inOverlayFullscreenVideo) |
3560 document().layoutViewItem().compositor()->setNeedsCompositingUpdate( | 3570 document().layoutViewItem().compositor()->setNeedsCompositingUpdate( |
3561 CompositingUpdateRebuildTree); | 3571 CompositingUpdateRebuildTree); |
3562 } | 3572 } |
3563 | 3573 |
3564 void HTMLMediaElement::didExitFullscreen() { | 3574 void HTMLMediaElement::didExitFullscreen() { |
3565 updateControlsVisibility(); | 3575 updateControlsVisibility(); |
3566 | 3576 |
| 3577 if (document().settings() && |
| 3578 document().settings()->getEmbeddedMediaExperienceEnabled()) { |
| 3579 mediaControls()->makeTransparent(); |
| 3580 } |
| 3581 |
3567 if (webMediaPlayer()) | 3582 if (webMediaPlayer()) |
3568 webMediaPlayer()->exitedFullscreen(); | 3583 webMediaPlayer()->exitedFullscreen(); |
3569 if (m_inOverlayFullscreenVideo) | 3584 if (m_inOverlayFullscreenVideo) |
3570 document().layoutViewItem().compositor()->setNeedsCompositingUpdate( | 3585 document().layoutViewItem().compositor()->setNeedsCompositingUpdate( |
3571 CompositingUpdateRebuildTree); | 3586 CompositingUpdateRebuildTree); |
3572 m_inOverlayFullscreenVideo = false; | 3587 m_inOverlayFullscreenVideo = false; |
3573 } | 3588 } |
3574 | 3589 |
3575 WebLayer* HTMLMediaElement::platformLayer() const { | 3590 WebLayer* HTMLMediaElement::platformLayer() const { |
3576 return m_webLayer; | 3591 return m_webLayer; |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4222 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); | 4237 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); |
4223 } | 4238 } |
4224 | 4239 |
4225 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { | 4240 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { |
4226 m_mostlyFillingViewport = true; | 4241 m_mostlyFillingViewport = true; |
4227 if (m_webMediaPlayer) | 4242 if (m_webMediaPlayer) |
4228 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); | 4243 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); |
4229 } | 4244 } |
4230 | 4245 |
4231 } // namespace blink | 4246 } // namespace blink |
OLD | NEW |