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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 if (m_volumeSlider) | 72 if (m_volumeSlider) |
73 m_volumeSlider->setMediaController(controller); | 73 m_volumeSlider->setMediaController(controller); |
74 if (m_toggleClosedCaptionsButton) | 74 if (m_toggleClosedCaptionsButton) |
75 m_toggleClosedCaptionsButton->setMediaController(controller); | 75 m_toggleClosedCaptionsButton->setMediaController(controller); |
76 if (m_fullScreenButton) | 76 if (m_fullScreenButton) |
77 m_fullScreenButton->setMediaController(controller); | 77 m_fullScreenButton->setMediaController(controller); |
78 } | 78 } |
79 | 79 |
80 void MediaControls::reset() | 80 void MediaControls::reset() |
81 { | 81 { |
82 Page* page = document()->page(); | 82 Page* page = document().page(); |
83 if (!page) | 83 if (!page) |
84 return; | 84 return; |
85 | 85 |
86 m_playButton->updateDisplayType(); | 86 m_playButton->updateDisplayType(); |
87 | 87 |
88 updateCurrentTimeDisplay(); | 88 updateCurrentTimeDisplay(); |
89 | 89 |
90 double duration = m_mediaController->duration(); | 90 double duration = m_mediaController->duration(); |
91 if (std::isfinite(duration) || RenderTheme::theme().hasOwnDisabledStateHandl
ingFor(MediaSliderPart)) { | 91 if (std::isfinite(duration) || RenderTheme::theme().hasOwnDisabledStateHandl
ingFor(MediaSliderPart)) { |
92 m_timeline->setDuration(duration); | 92 m_timeline->setDuration(duration); |
(...skipping 21 matching lines...) Expand all Loading... |
114 m_fullScreenButton->show(); | 114 m_fullScreenButton->show(); |
115 else | 115 else |
116 m_fullScreenButton->hide(); | 116 m_fullScreenButton->hide(); |
117 } | 117 } |
118 | 118 |
119 makeOpaque(); | 119 makeOpaque(); |
120 } | 120 } |
121 | 121 |
122 void MediaControls::reportedError() | 122 void MediaControls::reportedError() |
123 { | 123 { |
124 Page* page = document()->page(); | 124 Page* page = document().page(); |
125 if (!page) | 125 if (!page) |
126 return; | 126 return; |
127 | 127 |
128 if (!RenderTheme::theme().hasOwnDisabledStateHandlingFor(MediaMuteButtonPart
)) { | 128 if (!RenderTheme::theme().hasOwnDisabledStateHandlingFor(MediaMuteButtonPart
)) { |
129 m_panelMuteButton->hide(); | 129 m_panelMuteButton->hide(); |
130 m_volumeSlider->hide(); | 130 m_volumeSlider->hide(); |
131 } | 131 } |
132 | 132 |
133 if (m_toggleClosedCaptionsButton && !RenderTheme::theme().hasOwnDisabledStat
eHandlingFor(MediaToggleClosedCaptionsButtonPart)) | 133 if (m_toggleClosedCaptionsButton && !RenderTheme::theme().hasOwnDisabledStat
eHandlingFor(MediaToggleClosedCaptionsButtonPart)) |
134 m_toggleClosedCaptionsButton->hide(); | 134 m_toggleClosedCaptionsButton->hide(); |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 return; | 312 return; |
313 | 313 |
314 makeTransparent(); | 314 makeTransparent(); |
315 } | 315 } |
316 | 316 |
317 void MediaControls::startHideFullscreenControlsTimer() | 317 void MediaControls::startHideFullscreenControlsTimer() |
318 { | 318 { |
319 if (!m_isFullscreen) | 319 if (!m_isFullscreen) |
320 return; | 320 return; |
321 | 321 |
322 Page* page = document()->page(); | 322 Page* page = document().page(); |
323 if (!page) | 323 if (!page) |
324 return; | 324 return; |
325 | 325 |
326 m_hideFullscreenControlsTimer.startOneShot(timeWithoutMouseMovementBeforeHid
ingFullscreenControls); | 326 m_hideFullscreenControlsTimer.startOneShot(timeWithoutMouseMovementBeforeHid
ingFullscreenControls); |
327 } | 327 } |
328 | 328 |
329 void MediaControls::stopHideFullscreenControlsTimer() | 329 void MediaControls::stopHideFullscreenControlsTimer() |
330 { | 330 { |
331 m_hideFullscreenControlsTimer.stop(); | 331 m_hideFullscreenControlsTimer.stop(); |
332 } | 332 } |
(...skipping 12 matching lines...) Expand all Loading... |
345 if (!relatedTarget) | 345 if (!relatedTarget) |
346 return false; | 346 return false; |
347 return contains(relatedTarget->toNode()); | 347 return contains(relatedTarget->toNode()); |
348 } | 348 } |
349 | 349 |
350 void MediaControls::createTextTrackDisplay() | 350 void MediaControls::createTextTrackDisplay() |
351 { | 351 { |
352 if (m_textDisplayContainer) | 352 if (m_textDisplayContainer) |
353 return; | 353 return; |
354 | 354 |
355 RefPtr<MediaControlTextTrackContainerElement> textDisplayContainer = MediaCo
ntrolTextTrackContainerElement::create(document()); | 355 RefPtr<MediaControlTextTrackContainerElement> textDisplayContainer = MediaCo
ntrolTextTrackContainerElement::create(&document()); |
356 m_textDisplayContainer = textDisplayContainer.get(); | 356 m_textDisplayContainer = textDisplayContainer.get(); |
357 | 357 |
358 if (m_mediaController) | 358 if (m_mediaController) |
359 m_textDisplayContainer->setMediaController(m_mediaController); | 359 m_textDisplayContainer->setMediaController(m_mediaController); |
360 | 360 |
361 // Insert it before the first controller element so it always displays behin
d the controls. | 361 // Insert it before the first controller element so it always displays behin
d the controls. |
362 insertBefore(textDisplayContainer.release(), m_panel, IGNORE_EXCEPTION); | 362 insertBefore(textDisplayContainer.release(), m_panel, IGNORE_EXCEPTION); |
363 } | 363 } |
364 | 364 |
365 void MediaControls::showTextTrackDisplay() | 365 void MediaControls::showTextTrackDisplay() |
(...skipping 12 matching lines...) Expand all Loading... |
378 | 378 |
379 void MediaControls::updateTextTrackDisplay() | 379 void MediaControls::updateTextTrackDisplay() |
380 { | 380 { |
381 if (!m_textDisplayContainer) | 381 if (!m_textDisplayContainer) |
382 createTextTrackDisplay(); | 382 createTextTrackDisplay(); |
383 | 383 |
384 m_textDisplayContainer->updateDisplay(); | 384 m_textDisplayContainer->updateDisplay(); |
385 } | 385 } |
386 | 386 |
387 } | 387 } |
OLD | NEW |