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

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

Issue 2530883002: Refactor overlay fullscreen video handling into a single callback (Closed)
Patch Set: documentation Created 4 years 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 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 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1187 1187
1188 m_webMediaPlayer->setPoster(posterImageURL()); 1188 m_webMediaPlayer->setPoster(posterImageURL());
1189 1189
1190 m_webMediaPlayer->setPreload(effectivePreloadType()); 1190 m_webMediaPlayer->setPreload(effectivePreloadType());
1191 1191
1192 m_webMediaPlayer->requestRemotePlaybackDisabled( 1192 m_webMediaPlayer->requestRemotePlaybackDisabled(
1193 fastHasAttribute(disableremoteplaybackAttr)); 1193 fastHasAttribute(disableremoteplaybackAttr));
1194 1194
1195 m_webMediaPlayer->load(loadType(), source, corsMode()); 1195 m_webMediaPlayer->load(loadType(), source, corsMode());
1196 1196
1197 if (isFullscreen()) { 1197 if (isFullscreen())
1198 // This handles any transition to or from fullscreen overlay mode. 1198 m_webMediaPlayer->enteredFullscreen();
foolip 2016/11/24 21:03:39 This change isn't strictly necessary in this CL, b
watk 2016/11/29 21:11:00 I don't remember the details but I think this is f
foolip 2016/11/29 21:52:28 Just the m_inOverlayFullscreenVideo should be enou
1199 frame->chromeClient().enterFullscreenForElement(this);
1200 }
1201 } 1199 }
1202 1200
1203 void HTMLMediaElement::setPlayerPreload() { 1201 void HTMLMediaElement::setPlayerPreload() {
1204 if (m_webMediaPlayer) 1202 if (m_webMediaPlayer)
1205 m_webMediaPlayer->setPreload(effectivePreloadType()); 1203 m_webMediaPlayer->setPreload(effectivePreloadType());
1206 1204
1207 if (loadIsDeferred() && effectivePreloadType() != WebMediaPlayer::PreloadNone) 1205 if (loadIsDeferred() && effectivePreloadType() != WebMediaPlayer::PreloadNone)
1208 startDeferredLoad(); 1206 startDeferredLoad();
1209 } 1207 }
1210 1208
(...skipping 2282 matching lines...) Expand 10 before | Expand all | Expand 10 after
3493 3491
3494 Fullscreen::requestFullscreen(*this, Fullscreen::PrefixedRequest); 3492 Fullscreen::requestFullscreen(*this, Fullscreen::PrefixedRequest);
3495 } 3493 }
3496 3494
3497 void HTMLMediaElement::exitFullscreen() { 3495 void HTMLMediaElement::exitFullscreen() {
3498 BLINK_MEDIA_LOG << "exitFullscreen(" << (void*)this << ")"; 3496 BLINK_MEDIA_LOG << "exitFullscreen(" << (void*)this << ")";
3499 3497
3500 Fullscreen::exitFullscreen(document()); 3498 Fullscreen::exitFullscreen(document());
3501 } 3499 }
3502 3500
3503 void HTMLMediaElement::didBecomeFullscreenElement() { 3501 void HTMLMediaElement::didEnterFullscreen() {
3504 if (mediaControls()) 3502 if (mediaControls())
3505 mediaControls()->enteredFullscreen(); 3503 mediaControls()->enteredFullscreen();
3506 // FIXME: There is no embedder-side handling in layout test mode. 3504 // FIXME: There is no embedder-side handling in layout test mode.
3507 if (webMediaPlayer() && !LayoutTestSupport::isRunningLayoutTest()) 3505 if (webMediaPlayer() && !LayoutTestSupport::isRunningLayoutTest())
3508 webMediaPlayer()->enteredFullscreen(); 3506 webMediaPlayer()->enteredFullscreen();
3509 // Cache this in case the player is destroyed before leaving fullscreen. 3507 // Cache this in case the player is destroyed before leaving fullscreen.
3510 m_inOverlayFullscreenVideo = usesOverlayFullscreenVideo(); 3508 m_inOverlayFullscreenVideo = usesOverlayFullscreenVideo();
3511 if (m_inOverlayFullscreenVideo) 3509 if (m_inOverlayFullscreenVideo)
3512 document().layoutViewItem().compositor()->setNeedsCompositingUpdate( 3510 document().layoutViewItem().compositor()->setNeedsCompositingUpdate(
3513 CompositingUpdateRebuildTree); 3511 CompositingUpdateRebuildTree);
3514 } 3512 }
3515 3513
3516 void HTMLMediaElement::willStopBeingFullscreenElement() { 3514 void HTMLMediaElement::didExitFullscreen() {
3517 if (mediaControls()) 3515 if (mediaControls())
3518 mediaControls()->exitedFullscreen(); 3516 mediaControls()->exitedFullscreen();
3519 if (webMediaPlayer()) 3517 if (webMediaPlayer())
3520 webMediaPlayer()->exitedFullscreen(); 3518 webMediaPlayer()->exitedFullscreen();
3521 if (m_inOverlayFullscreenVideo) 3519 if (m_inOverlayFullscreenVideo)
3522 document().layoutViewItem().compositor()->setNeedsCompositingUpdate( 3520 document().layoutViewItem().compositor()->setNeedsCompositingUpdate(
3523 CompositingUpdateRebuildTree); 3521 CompositingUpdateRebuildTree);
3524 m_inOverlayFullscreenVideo = false; 3522 m_inOverlayFullscreenVideo = false;
3525 } 3523 }
3526 3524
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
4202 4200
4203 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() 4201 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect()
4204 const { 4202 const {
4205 IntRect result; 4203 IntRect result;
4206 if (LayoutObject* object = m_element->layoutObject()) 4204 if (LayoutObject* object = m_element->layoutObject())
4207 result = object->absoluteBoundingBoxRect(); 4205 result = object->absoluteBoundingBoxRect();
4208 return result; 4206 return result;
4209 } 4207 }
4210 4208
4211 } // namespace blink 4209 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698