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

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

Issue 13851023: Remove ChromeClient cruft (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/html/HTMLVideoElement.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 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 2376 matching lines...) Expand 10 before | Expand all | Expand 10 after
2387 } 2387 }
2388 2388
2389 bool HTMLMediaElement::controls() const 2389 bool HTMLMediaElement::controls() const
2390 { 2390 {
2391 Frame* frame = document()->frame(); 2391 Frame* frame = document()->frame();
2392 2392
2393 // always show controls when scripting is disabled 2393 // always show controls when scripting is disabled
2394 if (frame && !frame->script()->canExecuteScripts(NotAboutToExecuteScript)) 2394 if (frame && !frame->script()->canExecuteScripts(NotAboutToExecuteScript))
2395 return true; 2395 return true;
2396 2396
2397 // always show controls for video when fullscreen playback is required.
2398 if (isVideo() && document()->page() && document()->page()->chrome()->require sFullscreenForVideoPlayback())
2399 return true;
2400
2401 // Always show controls when in full screen mode. 2397 // Always show controls when in full screen mode.
2402 if (isFullscreen()) 2398 if (isFullscreen())
2403 return true; 2399 return true;
2404 2400
2405 return fastHasAttribute(controlsAttr); 2401 return fastHasAttribute(controlsAttr);
2406 } 2402 }
2407 2403
2408 void HTMLMediaElement::setControls(bool b) 2404 void HTMLMediaElement::setControls(bool b)
2409 { 2405 {
2410 LOG(Media, "HTMLMediaElement::setControls(%s)", boolString(b)); 2406 LOG(Media, "HTMLMediaElement::setControls(%s)", boolString(b));
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after
3575 bool playerPaused = m_player->paused(); 3571 bool playerPaused = m_player->paused();
3576 3572
3577 LOG(Media, "HTMLMediaElement::updatePlayState - shouldBePlaying = %s, player Paused = %s", 3573 LOG(Media, "HTMLMediaElement::updatePlayState - shouldBePlaying = %s, player Paused = %s",
3578 boolString(shouldBePlaying), boolString(playerPaused)); 3574 boolString(shouldBePlaying), boolString(playerPaused));
3579 3575
3580 if (shouldBePlaying) { 3576 if (shouldBePlaying) {
3581 setDisplayMode(Video); 3577 setDisplayMode(Video);
3582 invalidateCachedTime(); 3578 invalidateCachedTime();
3583 3579
3584 if (playerPaused) { 3580 if (playerPaused) {
3585 if (!m_isFullscreen && isVideo() && document() && document()->page() && document()->page()->chrome()->requiresFullscreenForVideoPlayback())
3586 enterFullscreen();
3587
3588 // Set rate, muted before calling play in case they were set before the media engine was setup. 3581 // Set rate, muted before calling play in case they were set before the media engine was setup.
3589 // The media engine should just stash the rate and muted values sinc e it isn't already playing. 3582 // The media engine should just stash the rate and muted values sinc e it isn't already playing.
3590 m_player->setRate(m_playbackRate); 3583 m_player->setRate(m_playbackRate);
3591 m_player->setMuted(m_muted); 3584 m_player->setMuted(m_muted);
3592 3585
3593 m_player->play(); 3586 m_player->play();
3594 } 3587 }
3595 3588
3596 if (hasMediaControls()) 3589 if (hasMediaControls())
3597 mediaControls()->playbackStarted(); 3590 mediaControls()->playbackStarted();
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
3823 if (document()->webkitIsFullScreen() && document()->webkitCurrentFullScr eenElement() == this) 3816 if (document()->webkitIsFullScreen() && document()->webkitCurrentFullScr eenElement() == this)
3824 document()->webkitCancelFullScreen(); 3817 document()->webkitCancelFullScreen();
3825 return; 3818 return;
3826 } 3819 }
3827 3820
3828 ASSERT(m_isFullscreen); 3821 ASSERT(m_isFullscreen);
3829 m_isFullscreen = false; 3822 m_isFullscreen = false;
3830 if (hasMediaControls()) 3823 if (hasMediaControls())
3831 mediaControls()->exitedFullscreen(); 3824 mediaControls()->exitedFullscreen();
3832 if (document() && document()->page()) { 3825 if (document() && document()->page()) {
3833 if (document()->page()->chrome()->requiresFullscreenForVideoPlayback())
3834 pauseInternal();
3835 document()->page()->chrome()->client()->exitFullscreenForNode(this); 3826 document()->page()->chrome()->client()->exitFullscreenForNode(this);
3836 scheduleEvent(eventNames().webkitendfullscreenEvent); 3827 scheduleEvent(eventNames().webkitendfullscreenEvent);
3837 } 3828 }
3838 } 3829 }
3839 3830
3840 void HTMLMediaElement::didBecomeFullscreenElement() 3831 void HTMLMediaElement::didBecomeFullscreenElement()
3841 { 3832 {
3842 if (hasMediaControls()) 3833 if (hasMediaControls())
3843 mediaControls()->enteredFullscreen(); 3834 mediaControls()->enteredFullscreen();
3844 } 3835 }
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
4442 info.addMember(m_mediaGroup, "mediaGroup"); 4433 info.addMember(m_mediaGroup, "mediaGroup");
4443 info.addMember(m_mediaController, "mediaController"); 4434 info.addMember(m_mediaController, "mediaController");
4444 4435
4445 #if ENABLE(WEB_AUDIO) 4436 #if ENABLE(WEB_AUDIO)
4446 info.addMember(m_audioSourceNode, "audioSourceNode"); 4437 info.addMember(m_audioSourceNode, "audioSourceNode");
4447 #endif 4438 #endif
4448 4439
4449 } 4440 }
4450 4441
4451 } 4442 }
OLDNEW
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/html/HTMLVideoElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698