OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef TextTrackRegion_h | 31 #ifndef TextTrackRegion_h |
32 #define TextTrackRegion_h | 32 #define TextTrackRegion_h |
33 | 33 |
34 #if ENABLE(WEBVTT_REGIONS) | |
35 | |
36 #include "core/dom/ContextLifecycleObserver.h" | 34 #include "core/dom/ContextLifecycleObserver.h" |
37 #include "core/dom/Document.h" | 35 #include "core/dom/Document.h" |
38 #include "core/html/track/TextTrack.h" | 36 #include "core/html/track/TextTrack.h" |
39 #include "platform/geometry/FloatPoint.h" | 37 #include "platform/geometry/FloatPoint.h" |
40 #include "wtf/PassOwnPtr.h" | 38 #include "wtf/PassOwnPtr.h" |
41 #include "wtf/RefCounted.h" | 39 #include "wtf/RefCounted.h" |
42 | 40 |
43 namespace WebCore { | 41 namespace WebCore { |
44 | 42 |
45 class ExceptionState; | 43 class ExceptionState; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 bool isScrollingRegion() { return m_scroll; } | 88 bool isScrollingRegion() { return m_scroll; } |
91 | 89 |
92 PassRefPtr<HTMLDivElement> getDisplayTree(); | 90 PassRefPtr<HTMLDivElement> getDisplayTree(); |
93 | 91 |
94 void appendTextTrackCueBox(PassRefPtr<TextTrackCueBox>); | 92 void appendTextTrackCueBox(PassRefPtr<TextTrackCueBox>); |
95 void displayLastTextTrackCueBox(); | 93 void displayLastTextTrackCueBox(); |
96 void willRemoveTextTrackCueBox(TextTrackCueBox*); | 94 void willRemoveTextTrackCueBox(TextTrackCueBox*); |
97 | 95 |
98 private: | 96 private: |
99 TextTrackRegion(ScriptExecutionContext*); | 97 TextTrackRegion(ScriptExecutionContext*); |
100 Document* ownerDocument() { return toDocument(m_scriptExecutionContext); } | 98 Document* ownerDocument() { return toDocument(scriptExecutionContext()); } |
101 | 99 |
102 void prepareRegionDisplayTree(); | 100 void prepareRegionDisplayTree(); |
103 | 101 |
104 // The timer is needed to continue processing when cue scrolling ended. | 102 // The timer is needed to continue processing when cue scrolling ended. |
105 void startTimer(); | 103 void startTimer(); |
106 void stopTimer(); | 104 void stopTimer(); |
107 void scrollTimerFired(Timer<TextTrackRegion>*); | 105 void scrollTimerFired(Timer<TextTrackRegion>*); |
108 | 106 |
109 enum RegionSetting { | 107 enum RegionSetting { |
110 None, | 108 None, |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 151 |
154 // The timer is used to display the next cue line after the current one has | 152 // The timer is used to display the next cue line after the current one has |
155 // been displayed. It's main use is for scrolling regions and it triggers as | 153 // been displayed. It's main use is for scrolling regions and it triggers as |
156 // soon as the animation for rolling out one line has finished, but | 154 // soon as the animation for rolling out one line has finished, but |
157 // currently it is used also for non-scrolling regions to use a single | 155 // currently it is used also for non-scrolling regions to use a single |
158 // code path. | 156 // code path. |
159 Timer<TextTrackRegion> m_scrollTimer; | 157 Timer<TextTrackRegion> m_scrollTimer; |
160 }; | 158 }; |
161 | 159 |
162 } // namespace WebCore | 160 } // namespace WebCore |
163 | |
164 #endif | 161 #endif |
165 #endif | |
OLD | NEW |