| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 if (!page) | 315 if (!page) |
| 316 return; | 316 return; |
| 317 | 317 |
| 318 updateStatusDisplay(); | 318 updateStatusDisplay(); |
| 319 | 319 |
| 320 if (m_mediaController->supportsFullscreen()) | 320 if (m_mediaController->supportsFullscreen()) |
| 321 m_fullScreenButton->show(); | 321 m_fullScreenButton->show(); |
| 322 else | 322 else |
| 323 m_fullScreenButton->hide(); | 323 m_fullScreenButton->hide(); |
| 324 | 324 |
| 325 float duration = m_mediaController->duration(); | 325 double duration = m_mediaController->duration(); |
| 326 if (std::isfinite(duration) || page->theme()->hasOwnDisabledStateHandlingFor
(MediaSliderPart)) { | 326 if (std::isfinite(duration) || page->theme()->hasOwnDisabledStateHandlingFor
(MediaSliderPart)) { |
| 327 m_timeline->setDuration(duration); | 327 m_timeline->setDuration(duration); |
| 328 m_timelineContainer->show(); | 328 m_timelineContainer->show(); |
| 329 m_timeline->setPosition(m_mediaController->currentTime()); | 329 m_timeline->setPosition(m_mediaController->currentTime()); |
| 330 updateCurrentTimeDisplay(); | 330 updateCurrentTimeDisplay(); |
| 331 } else | 331 } else |
| 332 m_timelineContainer->hide(); | 332 m_timelineContainer->hide(); |
| 333 | 333 |
| 334 if (m_mediaController->hasAudio() || page->theme()->hasOwnDisabledStateHandl
ingFor(MediaMuteButtonPart)) | 334 if (m_mediaController->hasAudio() || page->theme()->hasOwnDisabledStateHandl
ingFor(MediaMuteButtonPart)) |
| 335 m_panelMuteButton->show(); | 335 m_panelMuteButton->show(); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 } else { | 375 } else { |
| 376 m_returnToRealTimeButton->show(); | 376 m_returnToRealTimeButton->show(); |
| 377 m_rewindButton->hide(); | 377 m_rewindButton->hide(); |
| 378 } | 378 } |
| 379 | 379 |
| 380 makeOpaque(); | 380 makeOpaque(); |
| 381 } | 381 } |
| 382 | 382 |
| 383 void MediaControlsApple::updateCurrentTimeDisplay() | 383 void MediaControlsApple::updateCurrentTimeDisplay() |
| 384 { | 384 { |
| 385 float now = m_mediaController->currentTime(); | 385 double now = m_mediaController->currentTime(); |
| 386 float duration = m_mediaController->duration(); | 386 double duration = m_mediaController->duration(); |
| 387 | 387 |
| 388 Page* page = document()->page(); | 388 Page* page = document()->page(); |
| 389 if (!page) | 389 if (!page) |
| 390 return; | 390 return; |
| 391 | 391 |
| 392 // Allow the theme to format the time. | 392 // Allow the theme to format the time. |
| 393 m_currentTimeDisplay->setInnerText(page->theme()->formatMediaControlsCurrent
Time(now, duration), IGNORE_EXCEPTION); | 393 m_currentTimeDisplay->setInnerText(page->theme()->formatMediaControlsCurrent
Time(now, duration), IGNORE_EXCEPTION); |
| 394 m_currentTimeDisplay->setCurrentValue(now); | 394 m_currentTimeDisplay->setCurrentValue(now); |
| 395 m_timeRemainingDisplay->setInnerText(page->theme()->formatMediaControlsRemai
ningTime(now, duration), IGNORE_EXCEPTION); | 395 m_timeRemainingDisplay->setInnerText(page->theme()->formatMediaControlsRemai
ningTime(now, duration), IGNORE_EXCEPTION); |
| 396 m_timeRemainingDisplay->setCurrentValue(now - duration); | 396 m_timeRemainingDisplay->setCurrentValue(now - duration); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 if (m_mediaController->hasClosedCaptions()) | 516 if (m_mediaController->hasClosedCaptions()) |
| 517 m_toggleClosedCaptionsButton->show(); | 517 m_toggleClosedCaptionsButton->show(); |
| 518 else | 518 else |
| 519 m_toggleClosedCaptionsButton->hide(); | 519 m_toggleClosedCaptionsButton->hide(); |
| 520 } | 520 } |
| 521 } | 521 } |
| 522 | 522 |
| 523 } | 523 } |
| 524 | 524 |
| 525 #endif | 525 #endif |
| OLD | NEW |