| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2011, 2012 Google Inc. All rights 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 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 } | 664 } |
| 665 | 665 |
| 666 void MediaControls::enterFullscreen() { | 666 void MediaControls::enterFullscreen() { |
| 667 Fullscreen::requestFullscreen(mediaElement()); | 667 Fullscreen::requestFullscreen(mediaElement()); |
| 668 } | 668 } |
| 669 | 669 |
| 670 void MediaControls::exitFullscreen() { | 670 void MediaControls::exitFullscreen() { |
| 671 Fullscreen::exitFullscreen(document()); | 671 Fullscreen::exitFullscreen(document()); |
| 672 } | 672 } |
| 673 | 673 |
| 674 void MediaControls::didEnterFullscreen() { |
| 675 m_fullscreenButton->setIsFullscreen(true); |
| 676 stopHideMediaControlsTimer(); |
| 677 startHideMediaControlsTimer(); |
| 678 if (m_orientationLockDelegate) |
| 679 m_orientationLockDelegate->didEnterFullscreen(); |
| 680 } |
| 681 |
| 682 void MediaControls::didExitFullscreen() { |
| 683 m_fullscreenButton->setIsFullscreen(false); |
| 684 stopHideMediaControlsTimer(); |
| 685 startHideMediaControlsTimer(); |
| 686 if (m_orientationLockDelegate) |
| 687 m_orientationLockDelegate->didExitFullscreen(); |
| 688 } |
| 689 |
| 674 void MediaControls::startedCasting() { | 690 void MediaControls::startedCasting() { |
| 675 m_castButton->setIsPlayingRemotely(true); | 691 m_castButton->setIsPlayingRemotely(true); |
| 676 m_overlayCastButton->setIsPlayingRemotely(true); | 692 m_overlayCastButton->setIsPlayingRemotely(true); |
| 677 } | 693 } |
| 678 | 694 |
| 679 void MediaControls::stoppedCasting() { | 695 void MediaControls::stoppedCasting() { |
| 680 m_castButton->setIsPlayingRemotely(false); | 696 m_castButton->setIsPlayingRemotely(false); |
| 681 m_overlayCastButton->setIsPlayingRemotely(false); | 697 m_overlayCastButton->setIsPlayingRemotely(false); |
| 682 } | 698 } |
| 683 | 699 |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 // to be changed. | 891 // to be changed. |
| 876 reset(); | 892 reset(); |
| 877 } | 893 } |
| 878 | 894 |
| 879 void MediaControls::onLoadedMetadata() { | 895 void MediaControls::onLoadedMetadata() { |
| 880 // TODO(mlamouri): we should only change the aspects of the control that need | 896 // TODO(mlamouri): we should only change the aspects of the control that need |
| 881 // to be changed. | 897 // to be changed. |
| 882 reset(); | 898 reset(); |
| 883 } | 899 } |
| 884 | 900 |
| 885 void MediaControls::onEnteredFullscreen() { | |
| 886 m_fullscreenButton->setIsFullscreen(true); | |
| 887 stopHideMediaControlsTimer(); | |
| 888 startHideMediaControlsTimer(); | |
| 889 } | |
| 890 | |
| 891 void MediaControls::onExitedFullscreen() { | |
| 892 m_fullscreenButton->setIsFullscreen(false); | |
| 893 stopHideMediaControlsTimer(); | |
| 894 startHideMediaControlsTimer(); | |
| 895 } | |
| 896 | |
| 897 void MediaControls::notifyElementSizeChanged(ClientRect* newSize) { | 901 void MediaControls::notifyElementSizeChanged(ClientRect* newSize) { |
| 898 // Note that this code permits a bad frame on resize, since it is | 902 // Note that this code permits a bad frame on resize, since it is |
| 899 // run after the relayout / paint happens. It would be great to improve | 903 // run after the relayout / paint happens. It would be great to improve |
| 900 // this, but it would be even greater to move this code entirely to | 904 // this, but it would be even greater to move this code entirely to |
| 901 // JS and fix it there. | 905 // JS and fix it there. |
| 902 | 906 |
| 903 IntSize oldSize = m_size; | 907 IntSize oldSize = m_size; |
| 904 m_size.setWidth(newSize->width()); | 908 m_size.setWidth(newSize->width()); |
| 905 m_size.setHeight(newSize->height()); | 909 m_size.setHeight(newSize->height()); |
| 906 | 910 |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 visitor->trace(m_overflowList); | 1104 visitor->trace(m_overflowList); |
| 1101 visitor->trace(m_castButton); | 1105 visitor->trace(m_castButton); |
| 1102 visitor->trace(m_overlayCastButton); | 1106 visitor->trace(m_overlayCastButton); |
| 1103 visitor->trace(m_mediaEventListener); | 1107 visitor->trace(m_mediaEventListener); |
| 1104 visitor->trace(m_windowEventListener); | 1108 visitor->trace(m_windowEventListener); |
| 1105 visitor->trace(m_orientationLockDelegate); | 1109 visitor->trace(m_orientationLockDelegate); |
| 1106 HTMLDivElement::trace(visitor); | 1110 HTMLDivElement::trace(visitor); |
| 1107 } | 1111 } |
| 1108 | 1112 |
| 1109 } // namespace blink | 1113 } // namespace blink |
| OLD | NEW |