| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2  * Copyright (C) 2007, 2008, 2009, 2010 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 149         m_enclosure->setMediaController(controller); | 149         m_enclosure->setMediaController(controller); | 
| 150 } | 150 } | 
| 151 | 151 | 
| 152 void MediaControlsChromium::reset() | 152 void MediaControlsChromium::reset() | 
| 153 { | 153 { | 
| 154     Page* page = document()->page(); | 154     Page* page = document()->page(); | 
| 155     if (!page) | 155     if (!page) | 
| 156         return; | 156         return; | 
| 157 | 157 | 
| 158     double duration = m_mediaController->duration(); | 158     double duration = m_mediaController->duration(); | 
| 159     m_durationDisplay->setInnerText(page->theme()->formatMediaControlsTime(durat
     ion), ASSERT_NO_EXCEPTION_STATE); | 159     m_durationDisplay->setInnerText(page->theme()->formatMediaControlsTime(durat
     ion), ASSERT_NO_EXCEPTION); | 
| 160     m_durationDisplay->setCurrentValue(duration); | 160     m_durationDisplay->setCurrentValue(duration); | 
| 161 | 161 | 
| 162     MediaControls::reset(); | 162     MediaControls::reset(); | 
| 163 } | 163 } | 
| 164 | 164 | 
| 165 void MediaControlsChromium::playbackStarted() | 165 void MediaControlsChromium::playbackStarted() | 
| 166 { | 166 { | 
| 167     m_currentTimeDisplay->show(); | 167     m_currentTimeDisplay->show(); | 
| 168     m_durationDisplay->hide(); | 168     m_durationDisplay->hide(); | 
| 169 | 169 | 
| 170     MediaControls::playbackStarted(); | 170     MediaControls::playbackStarted(); | 
| 171 } | 171 } | 
| 172 | 172 | 
| 173 void MediaControlsChromium::updateCurrentTimeDisplay() | 173 void MediaControlsChromium::updateCurrentTimeDisplay() | 
| 174 { | 174 { | 
| 175     double now = m_mediaController->currentTime(); | 175     double now = m_mediaController->currentTime(); | 
| 176     double duration = m_mediaController->duration(); | 176     double duration = m_mediaController->duration(); | 
| 177 | 177 | 
| 178     Page* page = document()->page(); | 178     Page* page = document()->page(); | 
| 179     if (!page) | 179     if (!page) | 
| 180         return; | 180         return; | 
| 181 | 181 | 
| 182     // After seek, hide duration display and show current time. | 182     // After seek, hide duration display and show current time. | 
| 183     if (now > 0) { | 183     if (now > 0) { | 
| 184         m_currentTimeDisplay->show(); | 184         m_currentTimeDisplay->show(); | 
| 185         m_durationDisplay->hide(); | 185         m_durationDisplay->hide(); | 
| 186     } | 186     } | 
| 187 | 187 | 
| 188     // Allow the theme to format the time. | 188     // Allow the theme to format the time. | 
| 189     m_currentTimeDisplay->setInnerText(page->theme()->formatMediaControlsCurrent
     Time(now, duration), IGNORE_EXCEPTION_STATE); | 189     m_currentTimeDisplay->setInnerText(page->theme()->formatMediaControlsCurrent
     Time(now, duration), IGNORE_EXCEPTION); | 
| 190     m_currentTimeDisplay->setCurrentValue(now); | 190     m_currentTimeDisplay->setCurrentValue(now); | 
| 191 } | 191 } | 
| 192 | 192 | 
| 193 void MediaControlsChromium::changedMute() | 193 void MediaControlsChromium::changedMute() | 
| 194 { | 194 { | 
| 195     MediaControls::changedMute(); | 195     MediaControls::changedMute(); | 
| 196 | 196 | 
| 197     if (m_mediaController->muted()) | 197     if (m_mediaController->muted()) | 
| 198         m_volumeSlider->setVolume(0); | 198         m_volumeSlider->setVolume(0); | 
| 199     else | 199     else | 
| (...skipping 11 matching lines...) Expand all  Loading... | 
| 211     if (m_mediaController) | 211     if (m_mediaController) | 
| 212         m_textDisplayContainer->setMediaController(m_mediaController); | 212         m_textDisplayContainer->setMediaController(m_mediaController); | 
| 213 | 213 | 
| 214     insertTextTrackContainer(textDisplayContainer.release()); | 214     insertTextTrackContainer(textDisplayContainer.release()); | 
| 215 } | 215 } | 
| 216 | 216 | 
| 217 void MediaControlsChromium::insertTextTrackContainer(PassRefPtr<MediaControlText
     TrackContainerElement> textTrackContainer) | 217 void MediaControlsChromium::insertTextTrackContainer(PassRefPtr<MediaControlText
     TrackContainerElement> textTrackContainer) | 
| 218 { | 218 { | 
| 219     // Insert it before the first controller element so it always displays behin
     d the controls. | 219     // Insert it before the first controller element so it always displays behin
     d the controls. | 
| 220     // In the Chromium case, that's the enclosure element. | 220     // In the Chromium case, that's the enclosure element. | 
| 221     insertBefore(textTrackContainer, m_enclosure, ASSERT_NO_EXCEPTION_STATE, Att
     achLazily); | 221     insertBefore(textTrackContainer, m_enclosure, ASSERT_NO_EXCEPTION, AttachLaz
     ily); | 
| 222 } | 222 } | 
| 223 | 223 | 
| 224 | 224 | 
| 225 } | 225 } | 
| OLD | NEW | 
|---|