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

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

Issue 2793273002: Use internal hooks for notifying fullscreen changes to media controls (Closed)
Patch Set: update more tests Created 3 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLMediaElementEventListenersTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3501 matching lines...) Expand 10 before | Expand all | Expand 10 after
3512 bool HTMLMediaElement::isFullscreen() const { 3512 bool HTMLMediaElement::isFullscreen() const {
3513 return Fullscreen::isCurrentFullScreenElement(*this); 3513 return Fullscreen::isCurrentFullScreenElement(*this);
3514 } 3514 }
3515 3515
3516 void HTMLMediaElement::didEnterFullscreen() { 3516 void HTMLMediaElement::didEnterFullscreen() {
3517 updateControlsVisibility(); 3517 updateControlsVisibility();
3518 3518
3519 // FIXME: There is no embedder-side handling in layout test mode. 3519 // FIXME: There is no embedder-side handling in layout test mode.
3520 if (webMediaPlayer() && !LayoutTestSupport::isRunningLayoutTest()) 3520 if (webMediaPlayer() && !LayoutTestSupport::isRunningLayoutTest())
3521 webMediaPlayer()->enteredFullscreen(); 3521 webMediaPlayer()->enteredFullscreen();
3522 if (mediaControls())
3523 mediaControls()->didEnterFullscreen();
3522 // Cache this in case the player is destroyed before leaving fullscreen. 3524 // Cache this in case the player is destroyed before leaving fullscreen.
3523 m_inOverlayFullscreenVideo = usesOverlayFullscreenVideo(); 3525 m_inOverlayFullscreenVideo = usesOverlayFullscreenVideo();
3524 if (m_inOverlayFullscreenVideo) 3526 if (m_inOverlayFullscreenVideo)
3525 document().layoutViewItem().compositor()->setNeedsCompositingUpdate( 3527 document().layoutViewItem().compositor()->setNeedsCompositingUpdate(
3526 CompositingUpdateRebuildTree); 3528 CompositingUpdateRebuildTree);
3527 } 3529 }
3528 3530
3529 void HTMLMediaElement::didExitFullscreen() { 3531 void HTMLMediaElement::didExitFullscreen() {
3530 updateControlsVisibility(); 3532 updateControlsVisibility();
3531 3533
3532 if (webMediaPlayer()) 3534 if (webMediaPlayer())
3533 webMediaPlayer()->exitedFullscreen(); 3535 webMediaPlayer()->exitedFullscreen();
3536 if (mediaControls())
3537 mediaControls()->didExitFullscreen();
3534 if (m_inOverlayFullscreenVideo) 3538 if (m_inOverlayFullscreenVideo)
3535 document().layoutViewItem().compositor()->setNeedsCompositingUpdate( 3539 document().layoutViewItem().compositor()->setNeedsCompositingUpdate(
3536 CompositingUpdateRebuildTree); 3540 CompositingUpdateRebuildTree);
3537 m_inOverlayFullscreenVideo = false; 3541 m_inOverlayFullscreenVideo = false;
3538 } 3542 }
3539 3543
3540 WebLayer* HTMLMediaElement::platformLayer() const { 3544 WebLayer* HTMLMediaElement::platformLayer() const {
3541 return m_webLayer; 3545 return m_webLayer;
3542 } 3546 }
3543 3547
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
4187 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); 4191 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE);
4188 } 4192 }
4189 4193
4190 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { 4194 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) {
4191 m_mostlyFillingViewport = true; 4195 m_mostlyFillingViewport = true;
4192 if (m_webMediaPlayer) 4196 if (m_webMediaPlayer)
4193 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); 4197 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport);
4194 } 4198 }
4195 4199
4196 } // namespace blink 4200 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLMediaElementEventListenersTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698