| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 m_durationDisplay->setInnerText(RenderTheme::theme().formatMediaControlsTime
(duration), ASSERT_NO_EXCEPTION); | 176 m_durationDisplay->setInnerText(RenderTheme::theme().formatMediaControlsTime
(duration), ASSERT_NO_EXCEPTION); |
| 177 m_durationDisplay->setCurrentValue(duration); | 177 m_durationDisplay->setCurrentValue(duration); |
| 178 | 178 |
| 179 updatePlayState(); | 179 updatePlayState(); |
| 180 | 180 |
| 181 updateCurrentTimeDisplay(); | 181 updateCurrentTimeDisplay(); |
| 182 | 182 |
| 183 m_timeline->setDuration(mediaControllerInterface().duration()); | 183 m_timeline->setDuration(mediaControllerInterface().duration()); |
| 184 m_timeline->setPosition(mediaControllerInterface().currentTime()); | 184 m_timeline->setPosition(mediaControllerInterface().currentTime()); |
| 185 | 185 |
| 186 if (!mediaControllerInterface().hasAudio()) { | 186 if (!mediaElement().hasAudio()) |
| 187 m_volumeSlider->hide(); | 187 m_volumeSlider->hide(); |
| 188 } else { | 188 else |
| 189 m_volumeSlider->show(); | 189 m_volumeSlider->show(); |
| 190 m_volumeSlider->setVolume(mediaControllerInterface().volume()); | 190 updateVolume(); |
| 191 } | |
| 192 | 191 |
| 193 refreshClosedCaptionsButtonVisibility(); | 192 refreshClosedCaptionsButtonVisibility(); |
| 194 | 193 |
| 195 if (mediaElement().hasVideo()) | 194 if (mediaElement().hasVideo()) |
| 196 m_fullScreenButton->show(); | 195 m_fullScreenButton->show(); |
| 197 else | 196 else |
| 198 m_fullScreenButton->hide(); | 197 m_fullScreenButton->hide(); |
| 199 | 198 |
| 200 makeOpaque(); | 199 makeOpaque(); |
| 201 } | 200 } |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 if (now > 0) { | 295 if (now > 0) { |
| 297 m_currentTimeDisplay->show(); | 296 m_currentTimeDisplay->show(); |
| 298 m_durationDisplay->hide(); | 297 m_durationDisplay->hide(); |
| 299 } | 298 } |
| 300 | 299 |
| 301 // Allow the theme to format the time. | 300 // Allow the theme to format the time. |
| 302 m_currentTimeDisplay->setInnerText(RenderTheme::theme().formatMediaControlsC
urrentTime(now, duration), IGNORE_EXCEPTION); | 301 m_currentTimeDisplay->setInnerText(RenderTheme::theme().formatMediaControlsC
urrentTime(now, duration), IGNORE_EXCEPTION); |
| 303 m_currentTimeDisplay->setCurrentValue(now); | 302 m_currentTimeDisplay->setCurrentValue(now); |
| 304 } | 303 } |
| 305 | 304 |
| 306 void MediaControls::changedMute() | 305 void MediaControls::updateVolume() |
| 307 { | 306 { |
| 308 m_muteButton->updateDisplayType(); | 307 m_muteButton->updateDisplayType(); |
| 308 if (m_muteButton->renderer()) |
| 309 m_muteButton->renderer()->repaint(); |
| 309 | 310 |
| 310 if (mediaControllerInterface().muted()) | 311 if (mediaElement().muted()) |
| 311 m_volumeSlider->setVolume(0); | 312 m_volumeSlider->setVolume(0); |
| 312 else | 313 else |
| 313 m_volumeSlider->setVolume(mediaControllerInterface().volume()); | 314 m_volumeSlider->setVolume(mediaElement().volume()); |
| 314 } | |
| 315 | |
| 316 void MediaControls::changedVolume() | |
| 317 { | |
| 318 m_volumeSlider->setVolume(mediaControllerInterface().volume()); | |
| 319 if (m_muteButton->renderer()) | |
| 320 m_muteButton->renderer()->repaint(); | |
| 321 } | 315 } |
| 322 | 316 |
| 323 void MediaControls::changedClosedCaptionsVisibility() | 317 void MediaControls::changedClosedCaptionsVisibility() |
| 324 { | 318 { |
| 325 m_toggleClosedCaptionsButton->updateDisplayType(); | 319 m_toggleClosedCaptionsButton->updateDisplayType(); |
| 326 } | 320 } |
| 327 | 321 |
| 328 void MediaControls::refreshClosedCaptionsButtonVisibility() | 322 void MediaControls::refreshClosedCaptionsButtonVisibility() |
| 329 { | 323 { |
| 330 if (mediaElement().hasClosedCaptions()) | 324 if (mediaElement().hasClosedCaptions()) |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 | 456 |
| 463 void MediaControls::updateTextTrackDisplay() | 457 void MediaControls::updateTextTrackDisplay() |
| 464 { | 458 { |
| 465 if (!m_textDisplayContainer) | 459 if (!m_textDisplayContainer) |
| 466 createTextTrackDisplay(); | 460 createTextTrackDisplay(); |
| 467 | 461 |
| 468 m_textDisplayContainer->updateDisplay(); | 462 m_textDisplayContainer->updateDisplay(); |
| 469 } | 463 } |
| 470 | 464 |
| 471 } | 465 } |
| OLD | NEW |