| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, Opera Software ASA. All rights reserved. | 2 * Copyright (c) 2013, Opera Software ASA. 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 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 25 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 27 * OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #ifndef VTTCue_h | 30 #ifndef VTTCue_h |
| 31 #define VTTCue_h | 31 #define VTTCue_h |
| 32 | 32 |
| 33 #include "bindings/v8/ScriptWrappable.h" | 33 #include "bindings/v8/ScriptWrappable.h" |
| 34 #include "core/html/track/TextTrackCue.h" | 34 #include "core/html/track/TextTrackCue.h" |
| 35 #include "platform/heap/Handle.h" |
| 35 | 36 |
| 36 namespace WebCore { | 37 namespace WebCore { |
| 37 | 38 |
| 38 class Document; | 39 class Document; |
| 39 class ExecutionContext; | 40 class ExecutionContext; |
| 40 class VTTCue; | 41 class VTTCue; |
| 41 class VTTScanner; | 42 class VTTScanner; |
| 42 | 43 |
| 43 class VTTCueBox FINAL : public HTMLDivElement { | 44 class VTTCueBox FINAL : public HTMLDivElement { |
| 44 public: | 45 public: |
| 45 static PassRefPtr<VTTCueBox> create(Document& document, VTTCue* cue) | 46 static PassRefPtr<VTTCueBox> create(Document& document, VTTCue* cue) |
| 46 { | 47 { |
| 47 return adoptRef(new VTTCueBox(document, cue)); | 48 return adoptRef(new VTTCueBox(document, cue)); |
| 48 } | 49 } |
| 49 | 50 |
| 50 VTTCue* getCue() const { return m_cue; } | 51 VTTCue* getCue() const { return m_cue; } |
| 51 void applyCSSProperties(const IntSize& videoSize); | 52 void applyCSSProperties(const IntSize& videoSize); |
| 52 | 53 |
| 53 private: | 54 private: |
| 54 VTTCueBox(Document&, VTTCue*); | 55 VTTCueBox(Document&, VTTCue*); |
| 55 | 56 |
| 56 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; | 57 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; |
| 57 | 58 |
| 58 VTTCue* m_cue; | 59 RawPtrWillBePersistent<VTTCue> m_cue; |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 class VTTCue FINAL : public TextTrackCue, public ScriptWrappable { | 62 class VTTCue FINAL : public TextTrackCue, public ScriptWrappable { |
| 62 public: | 63 public: |
| 63 static PassRefPtr<VTTCue> create(Document& document, double startTime, doubl
e endTime, const String& text) | 64 static PassRefPtrWillBeRawPtr<VTTCue> create(Document& document, double star
tTime, double endTime, const String& text) |
| 64 { | 65 { |
| 65 return adoptRef(new VTTCue(document, startTime, endTime, text)); | 66 return adoptRefWillBeRefCountedGarbageCollected(new VTTCue(document, sta
rtTime, endTime, text)); |
| 66 } | 67 } |
| 67 | 68 |
| 68 virtual ~VTTCue(); | 69 virtual ~VTTCue(); |
| 69 | 70 |
| 70 const String& vertical() const; | 71 const String& vertical() const; |
| 71 void setVertical(const String&, ExceptionState&); | 72 void setVertical(const String&, ExceptionState&); |
| 72 | 73 |
| 73 bool snapToLines() const { return m_snapToLines; } | 74 bool snapToLines() const { return m_snapToLines; } |
| 74 void setSnapToLines(bool); | 75 void setSnapToLines(bool); |
| 75 | 76 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 NumberOfAlignments | 131 NumberOfAlignments |
| 131 }; | 132 }; |
| 132 CueAlignment getAlignment() const { return m_cueAlignment; } | 133 CueAlignment getAlignment() const { return m_cueAlignment; } |
| 133 | 134 |
| 134 virtual ExecutionContext* executionContext() const OVERRIDE; | 135 virtual ExecutionContext* executionContext() const OVERRIDE; |
| 135 | 136 |
| 136 #ifndef NDEBUG | 137 #ifndef NDEBUG |
| 137 virtual String toString() const OVERRIDE; | 138 virtual String toString() const OVERRIDE; |
| 138 #endif | 139 #endif |
| 139 | 140 |
| 141 virtual void trace(Visitor*) OVERRIDE; |
| 142 |
| 140 private: | 143 private: |
| 141 VTTCue(Document&, double startTime, double endTime, const String& text); | 144 VTTCue(Document&, double startTime, double endTime, const String& text); |
| 142 | 145 |
| 143 Document& document() const; | 146 Document& document() const; |
| 144 | 147 |
| 145 VTTCueBox& ensureDisplayTree(); | 148 VTTCueBox& ensureDisplayTree(); |
| 146 PassRefPtr<VTTCueBox> getDisplayTree(const IntSize& videoSize); | 149 PassRefPtr<VTTCueBox> getDisplayTree(const IntSize& videoSize); |
| 147 | 150 |
| 148 virtual void cueDidChange() OVERRIDE; | 151 virtual void cueDidChange() OVERRIDE; |
| 149 | 152 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 bool m_displayTreeShouldChange : 1; | 189 bool m_displayTreeShouldChange : 1; |
| 187 bool m_notifyRegion : 1; | 190 bool m_notifyRegion : 1; |
| 188 }; | 191 }; |
| 189 | 192 |
| 190 // VTTCue is currently the only TextTrackCue subclass. | 193 // VTTCue is currently the only TextTrackCue subclass. |
| 191 DEFINE_TYPE_CASTS(VTTCue, TextTrackCue, cue, true, true); | 194 DEFINE_TYPE_CASTS(VTTCue, TextTrackCue, cue, true, true); |
| 192 | 195 |
| 193 } // namespace WebCore | 196 } // namespace WebCore |
| 194 | 197 |
| 195 #endif | 198 #endif |
| OLD | NEW |