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 14 matching lines...) Expand all Loading... |
25 | 25 |
26 #include "config.h" | 26 #include "config.h" |
27 #include "core/html/shadow/MediaControlsChromiumAndroid.h" | 27 #include "core/html/shadow/MediaControlsChromiumAndroid.h" |
28 | 28 |
29 #include "bindings/v8/ExceptionState.h" | 29 #include "bindings/v8/ExceptionState.h" |
30 #include "bindings/v8/ExceptionStatePlaceholder.h" | 30 #include "bindings/v8/ExceptionStatePlaceholder.h" |
31 | 31 |
32 namespace WebCore { | 32 namespace WebCore { |
33 | 33 |
34 MediaControlsChromiumAndroid::MediaControlsChromiumAndroid(Document& document) | 34 MediaControlsChromiumAndroid::MediaControlsChromiumAndroid(Document& document) |
35 : MediaControls(document) | 35 : MediaControlsChromium(document) |
36 , m_overlayPlayButton(0) | 36 , m_overlayPlayButton(0) |
37 , m_overlayEnclosure(0) | 37 , m_overlayEnclosure(0) |
38 { | 38 { |
39 } | 39 } |
40 | 40 |
41 PassRefPtr<MediaControls> MediaControls::create(Document& document) | 41 PassRefPtr<MediaControls> MediaControls::create(Document& document) |
42 { | 42 { |
| 43 return MediaControlsChromiumAndroid::createControls(document); |
| 44 } |
| 45 |
| 46 PassRefPtr<MediaControlsChromiumAndroid> MediaControlsChromiumAndroid::createCon
trols(Document& document) |
| 47 { |
43 if (!document.page()) | 48 if (!document.page()) |
44 return 0; | 49 return 0; |
45 | 50 |
46 RefPtr<MediaControlsChromiumAndroid> controls = adoptRef(new MediaControlsCh
romiumAndroid(document)); | 51 RefPtr<MediaControlsChromiumAndroid> controls = adoptRef(new MediaControlsCh
romiumAndroid(document)); |
47 | 52 |
48 TrackExceptionState exceptionState; | 53 TrackExceptionState exceptionState; |
49 | 54 |
50 RefPtr<MediaControlOverlayEnclosureElement> overlayEnclosure = MediaControlO
verlayEnclosureElement::create(document); | 55 RefPtr<MediaControlOverlayEnclosureElement> overlayEnclosure = MediaControlO
verlayEnclosureElement::create(document); |
51 RefPtr<MediaControlOverlayPlayButtonElement> overlayPlayButton = MediaContro
lOverlayPlayButtonElement::create(document); | 56 RefPtr<MediaControlOverlayPlayButtonElement> overlayPlayButton = MediaContro
lOverlayPlayButtonElement::create(document); |
52 controls->m_overlayPlayButton = overlayPlayButton.get(); | 57 controls->m_overlayPlayButton = overlayPlayButton.get(); |
(...skipping 11 matching lines...) Expand all Loading... |
64 | 69 |
65 return 0; | 70 return 0; |
66 } | 71 } |
67 | 72 |
68 void MediaControlsChromiumAndroid::setMediaController(MediaControllerInterface*
controller) | 73 void MediaControlsChromiumAndroid::setMediaController(MediaControllerInterface*
controller) |
69 { | 74 { |
70 if (m_overlayPlayButton) | 75 if (m_overlayPlayButton) |
71 m_overlayPlayButton->setMediaController(controller); | 76 m_overlayPlayButton->setMediaController(controller); |
72 if (m_overlayEnclosure) | 77 if (m_overlayEnclosure) |
73 m_overlayEnclosure->setMediaController(controller); | 78 m_overlayEnclosure->setMediaController(controller); |
74 MediaControls::setMediaController(controller); | 79 MediaControlsChromium::setMediaController(controller); |
75 } | 80 } |
76 | 81 |
77 void MediaControlsChromiumAndroid::playbackStarted() | 82 void MediaControlsChromiumAndroid::playbackStarted() |
78 { | 83 { |
79 m_overlayPlayButton->updateDisplayType(); | 84 m_overlayPlayButton->updateDisplayType(); |
80 MediaControls::playbackStarted(); | 85 MediaControlsChromium::playbackStarted(); |
81 } | 86 } |
82 | 87 |
83 void MediaControlsChromiumAndroid::playbackStopped() | 88 void MediaControlsChromiumAndroid::playbackStopped() |
84 { | 89 { |
85 m_overlayPlayButton->updateDisplayType(); | 90 m_overlayPlayButton->updateDisplayType(); |
86 MediaControls::playbackStopped(); | 91 MediaControlsChromium::playbackStopped(); |
87 } | 92 } |
88 | 93 |
89 void MediaControlsChromiumAndroid::insertTextTrackContainer(PassRefPtr<MediaCont
rolTextTrackContainerElement> textTrackContainer) | 94 void MediaControlsChromiumAndroid::insertTextTrackContainer(PassRefPtr<MediaCont
rolTextTrackContainerElement> textTrackContainer) |
90 { | 95 { |
91 // 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. |
92 m_overlayEnclosure->insertBefore(textTrackContainer, m_overlayPlayButton); | 97 m_overlayEnclosure->insertBefore(textTrackContainer, m_overlayPlayButton); |
93 } | 98 } |
94 } | 99 } |
OLD | NEW |