| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 return MediaControlsChromiumAndroid::createControls(document); | 43 return MediaControlsChromiumAndroid::createControls(document); |
| 44 } | 44 } |
| 45 | 45 |
| 46 PassRefPtr<MediaControlsChromiumAndroid> MediaControlsChromiumAndroid::createCon
trols(Document& document) | 46 PassRefPtr<MediaControlsChromiumAndroid> MediaControlsChromiumAndroid::createCon
trols(Document& document) |
| 47 { | 47 { |
| 48 if (!document.page()) | 48 if (!document.page()) |
| 49 return 0; | 49 return 0; |
| 50 | 50 |
| 51 RefPtr<MediaControlsChromiumAndroid> controls = adoptRef(new MediaControlsCh
romiumAndroid(document)); | 51 RefPtr<MediaControlsChromiumAndroid> controls = adoptRef(new MediaControlsCh
romiumAndroid(document)); |
| 52 | 52 |
| 53 TrackExceptionState es; | 53 TrackExceptionState exceptionState; |
| 54 | 54 |
| 55 RefPtr<MediaControlOverlayEnclosureElement> overlayEnclosure = MediaControlO
verlayEnclosureElement::create(document); | 55 RefPtr<MediaControlOverlayEnclosureElement> overlayEnclosure = MediaControlO
verlayEnclosureElement::create(document); |
| 56 RefPtr<MediaControlOverlayPlayButtonElement> overlayPlayButton = MediaContro
lOverlayPlayButtonElement::create(document); | 56 RefPtr<MediaControlOverlayPlayButtonElement> overlayPlayButton = MediaContro
lOverlayPlayButtonElement::create(document); |
| 57 controls->m_overlayPlayButton = overlayPlayButton.get(); | 57 controls->m_overlayPlayButton = overlayPlayButton.get(); |
| 58 overlayEnclosure->appendChild(overlayPlayButton.release(), es); | 58 overlayEnclosure->appendChild(overlayPlayButton.release(), exceptionState); |
| 59 if (es.hadException()) | 59 if (exceptionState.hadException()) |
| 60 return 0; | 60 return 0; |
| 61 | 61 |
| 62 controls->m_overlayEnclosure = overlayEnclosure.get(); | 62 controls->m_overlayEnclosure = overlayEnclosure.get(); |
| 63 controls->appendChild(overlayEnclosure.release(), es); | 63 controls->appendChild(overlayEnclosure.release(), exceptionState); |
| 64 if (es.hadException()) | 64 if (exceptionState.hadException()) |
| 65 return 0; | 65 return 0; |
| 66 | 66 |
| 67 if (controls->initializeControls(document)) | 67 if (controls->initializeControls(document)) |
| 68 return controls.release(); | 68 return controls.release(); |
| 69 | 69 |
| 70 return 0; | 70 return 0; |
| 71 } | 71 } |
| 72 | 72 |
| 73 void MediaControlsChromiumAndroid::setMediaController(MediaControllerInterface*
controller) | 73 void MediaControlsChromiumAndroid::setMediaController(MediaControllerInterface*
controller) |
| 74 { | 74 { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 90 m_overlayPlayButton->updateDisplayType(); | 90 m_overlayPlayButton->updateDisplayType(); |
| 91 MediaControlsChromium::playbackStopped(); | 91 MediaControlsChromium::playbackStopped(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void MediaControlsChromiumAndroid::insertTextTrackContainer(PassRefPtr<MediaCont
rolTextTrackContainerElement> textTrackContainer) | 94 void MediaControlsChromiumAndroid::insertTextTrackContainer(PassRefPtr<MediaCont
rolTextTrackContainerElement> textTrackContainer) |
| 95 { | 95 { |
| 96 // Insert it before the overlay play button so it always displays behind it. | 96 // Insert it before the overlay play button so it always displays behind it. |
| 97 m_overlayEnclosure->insertBefore(textTrackContainer, m_overlayPlayButton); | 97 m_overlayEnclosure->insertBefore(textTrackContainer, m_overlayPlayButton); |
| 98 } | 98 } |
| 99 } | 99 } |
| OLD | NEW |