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

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

Issue 2557043003: Make media controls not depend on the webkitfullscreenchange event (Closed)
Patch Set: 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
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMediaElement.h ('k') | no next file » | 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 3371 matching lines...) Expand 10 before | Expand all | Expand 10 after
3382 Fullscreen::requestFullscreen(*this, Fullscreen::PrefixedRequest); 3382 Fullscreen::requestFullscreen(*this, Fullscreen::PrefixedRequest);
3383 } 3383 }
3384 3384
3385 void HTMLMediaElement::exitFullscreen() { 3385 void HTMLMediaElement::exitFullscreen() {
3386 BLINK_MEDIA_LOG << "exitFullscreen(" << (void*)this << ")"; 3386 BLINK_MEDIA_LOG << "exitFullscreen(" << (void*)this << ")";
3387 3387
3388 Fullscreen::exitFullscreen(document()); 3388 Fullscreen::exitFullscreen(document());
3389 } 3389 }
3390 3390
3391 void HTMLMediaElement::didEnterFullscreen() { 3391 void HTMLMediaElement::didEnterFullscreen() {
3392 configureMediaControls();
3392 if (mediaControls()) 3393 if (mediaControls())
3393 mediaControls()->enteredFullscreen(); 3394 mediaControls()->enteredFullscreen();
3394 // FIXME: There is no embedder-side handling in layout test mode. 3395 // FIXME: There is no embedder-side handling in layout test mode.
3395 if (webMediaPlayer() && !LayoutTestSupport::isRunningLayoutTest()) 3396 if (webMediaPlayer() && !LayoutTestSupport::isRunningLayoutTest())
3396 webMediaPlayer()->enteredFullscreen(); 3397 webMediaPlayer()->enteredFullscreen();
3397 // Cache this in case the player is destroyed before leaving fullscreen. 3398 // Cache this in case the player is destroyed before leaving fullscreen.
3398 m_inOverlayFullscreenVideo = usesOverlayFullscreenVideo(); 3399 m_inOverlayFullscreenVideo = usesOverlayFullscreenVideo();
3399 if (m_inOverlayFullscreenVideo) 3400 if (m_inOverlayFullscreenVideo)
3400 document().layoutViewItem().compositor()->setNeedsCompositingUpdate( 3401 document().layoutViewItem().compositor()->setNeedsCompositingUpdate(
3401 CompositingUpdateRebuildTree); 3402 CompositingUpdateRebuildTree);
3402 } 3403 }
3403 3404
3404 void HTMLMediaElement::didExitFullscreen() { 3405 void HTMLMediaElement::didExitFullscreen() {
3406 configureMediaControls();
3405 if (mediaControls()) 3407 if (mediaControls())
3406 mediaControls()->exitedFullscreen(); 3408 mediaControls()->exitedFullscreen();
3407 if (webMediaPlayer()) 3409 if (webMediaPlayer())
3408 webMediaPlayer()->exitedFullscreen(); 3410 webMediaPlayer()->exitedFullscreen();
3409 if (m_inOverlayFullscreenVideo) 3411 if (m_inOverlayFullscreenVideo)
3410 document().layoutViewItem().compositor()->setNeedsCompositingUpdate( 3412 document().layoutViewItem().compositor()->setNeedsCompositingUpdate(
3411 CompositingUpdateRebuildTree); 3413 CompositingUpdateRebuildTree);
3412 m_inOverlayFullscreenVideo = false; 3414 m_inOverlayFullscreenVideo = false;
3413 } 3415 }
3414 3416
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
3635 3637
3636 // Note: The "time marches on" algorithm (updateActiveCues) runs the "rules 3638 // Note: The "time marches on" algorithm (updateActiveCues) runs the "rules
3637 // for updating the text track rendering" (updateTextTrackDisplay) only for 3639 // for updating the text track rendering" (updateTextTrackDisplay) only for
3638 // "affected tracks", i.e. tracks where the the active cues have changed. 3640 // "affected tracks", i.e. tracks where the the active cues have changed.
3639 // This misses cues in tracks that changed mode between hidden and showing. 3641 // This misses cues in tracks that changed mode between hidden and showing.
3640 // This appears to be a spec bug, which we work around here: 3642 // This appears to be a spec bug, which we work around here:
3641 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=28236 3643 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=28236
3642 updateTextTrackDisplay(); 3644 updateTextTrackDisplay();
3643 } 3645 }
3644 3646
3645 EventDispatchHandlingState* HTMLMediaElement::preDispatchEventHandler(
3646 Event* event) {
3647 if (event && event->type() == EventTypeNames::webkitfullscreenchange)
3648 configureMediaControls();
3649
3650 return nullptr;
3651 }
3652
3653 // TODO(srirama.m): Merge it to resetMediaElement if possible and remove it. 3647 // TODO(srirama.m): Merge it to resetMediaElement if possible and remove it.
3654 void HTMLMediaElement::resetMediaPlayerAndMediaSource() { 3648 void HTMLMediaElement::resetMediaPlayerAndMediaSource() {
3655 closeMediaSource(); 3649 closeMediaSource();
3656 3650
3657 { 3651 {
3658 AudioSourceProviderClientLockScope scope(*this); 3652 AudioSourceProviderClientLockScope scope(*this);
3659 clearMediaPlayerAndAudioSourceProviderClientWithoutLocking(); 3653 clearMediaPlayerAndAudioSourceProviderClientWithoutLocking();
3660 } 3654 }
3661 3655
3662 // We haven't yet found out if any remote routes are available. 3656 // We haven't yet found out if any remote routes are available.
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
4061 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); 4055 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE);
4062 } 4056 }
4063 4057
4064 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { 4058 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) {
4065 m_mostlyFillingViewport = true; 4059 m_mostlyFillingViewport = true;
4066 if (m_webMediaPlayer) 4060 if (m_webMediaPlayer)
4067 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); 4061 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport);
4068 } 4062 }
4069 4063
4070 } // namespace blink 4064 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMediaElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698