| 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 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 if (mediaElement().paused()) { | 702 if (mediaElement().paused()) { |
| 703 makeOpaque(); | 703 makeOpaque(); |
| 704 return; | 704 return; |
| 705 } | 705 } |
| 706 | 706 |
| 707 if (isVisible() && shouldHideMediaControls()) | 707 if (isVisible() && shouldHideMediaControls()) |
| 708 makeTransparent(); | 708 makeTransparent(); |
| 709 } | 709 } |
| 710 | 710 |
| 711 void MediaControls::onDurationChange() { | 711 void MediaControls::onDurationChange() { |
| 712 m_timeline->setDuration(mediaElement().duration()); | 712 const double duration = mediaElement().duration(); |
| 713 |
| 714 // Update the displayed current time/duration. |
| 715 m_durationDisplay->setTextContent( |
| 716 LayoutTheme::theme().formatMediaControlsTime(duration)); |
| 717 m_durationDisplay->setCurrentValue(duration); |
| 713 updateCurrentTimeDisplay(); | 718 updateCurrentTimeDisplay(); |
| 719 |
| 720 // Update the timeline (the UI with the seek marker). |
| 721 m_timeline->setDuration(duration); |
| 714 } | 722 } |
| 715 | 723 |
| 716 void MediaControls::onPlay() { | 724 void MediaControls::onPlay() { |
| 717 updatePlayState(); | 725 updatePlayState(); |
| 718 m_timeline->setPosition(mediaElement().currentTime()); | 726 m_timeline->setPosition(mediaElement().currentTime()); |
| 719 updateCurrentTimeDisplay(); | 727 updateCurrentTimeDisplay(); |
| 720 | 728 |
| 721 startHideMediaControlsTimer(); | 729 startHideMediaControlsTimer(); |
| 722 } | 730 } |
| 723 | 731 |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 visitor->trace(m_overflowList); | 962 visitor->trace(m_overflowList); |
| 955 visitor->trace(m_castButton); | 963 visitor->trace(m_castButton); |
| 956 visitor->trace(m_overlayCastButton); | 964 visitor->trace(m_overlayCastButton); |
| 957 visitor->trace(m_mediaEventListener); | 965 visitor->trace(m_mediaEventListener); |
| 958 visitor->trace(m_windowEventListener); | 966 visitor->trace(m_windowEventListener); |
| 959 visitor->trace(m_orientationLockDelegate); | 967 visitor->trace(m_orientationLockDelegate); |
| 960 HTMLDivElement::trace(visitor); | 968 HTMLDivElement::trace(visitor); |
| 961 } | 969 } |
| 962 | 970 |
| 963 } // namespace blink | 971 } // namespace blink |
| OLD | NEW |