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 21 matching lines...) Expand all Loading... |
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 | 35 |
36 namespace WebCore { | 36 namespace WebCore { |
37 | 37 |
38 class Document; | 38 class Document; |
39 class ExecutionContext; | 39 class ExecutionContext; |
40 class VTTCue; | 40 class VTTCue; |
41 | 41 |
42 // ---------------------------- | 42 class VTTCueBox FINAL : public HTMLDivElement { |
43 | |
44 class VTTCueBox FINAL : public TextTrackCueBox { | |
45 public: | 43 public: |
46 static PassRefPtr<VTTCueBox> create(Document& document, VTTCue* cue) | 44 static PassRefPtr<VTTCueBox> create(Document& document, VTTCue* cue) |
47 { | 45 { |
48 return adoptRef(new VTTCueBox(document, cue)); | 46 return adoptRef(new VTTCueBox(document, cue)); |
49 } | 47 } |
50 | 48 |
51 VTTCue* getCue() const { return m_cue; } | 49 VTTCue* getCue() const { return m_cue; } |
52 void applyCSSProperties(const IntSize& videoSize); | 50 void applyCSSProperties(const IntSize& videoSize); |
53 | 51 |
54 protected: | 52 private: |
55 VTTCueBox(Document&, VTTCue*); | 53 VTTCueBox(Document&, VTTCue*); |
56 | 54 |
57 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; | 55 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; |
58 | 56 |
59 VTTCue* m_cue; | 57 VTTCue* m_cue; |
60 }; | 58 }; |
61 | 59 |
62 // ---------------------------- | |
63 | |
64 class VTTCue FINAL : public TextTrackCue, public ScriptWrappable { | 60 class VTTCue FINAL : public TextTrackCue, public ScriptWrappable { |
65 public: | 61 public: |
66 static PassRefPtr<VTTCue> create(Document& document, double startTime, doubl
e endTime, const String& text) | 62 static PassRefPtr<VTTCue> create(Document& document, double startTime, doubl
e endTime, const String& text) |
67 { | 63 { |
68 return adoptRef(new VTTCue(document, startTime, endTime, text)); | 64 return adoptRef(new VTTCue(document, startTime, endTime, text)); |
69 } | 65 } |
70 | 66 |
71 virtual ~VTTCue(); | 67 virtual ~VTTCue(); |
72 | 68 |
73 const String& vertical() const; | 69 const String& vertical() const; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 virtual ExecutionContext* executionContext() const OVERRIDE; | 133 virtual ExecutionContext* executionContext() const OVERRIDE; |
138 | 134 |
139 virtual String toString() const; | 135 virtual String toString() const; |
140 | 136 |
141 private: | 137 private: |
142 VTTCue(Document&, double startTime, double endTime, const String& text); | 138 VTTCue(Document&, double startTime, double endTime, const String& text); |
143 | 139 |
144 Document& document() const; | 140 Document& document() const; |
145 | 141 |
146 PassRefPtr<VTTCueBox> displayTreeInternal(); | 142 PassRefPtr<VTTCueBox> displayTreeInternal(); |
147 PassRefPtr<TextTrackCueBox> getDisplayTree(const IntSize& videoSize); | 143 PassRefPtr<VTTCueBox> getDisplayTree(const IntSize& videoSize); |
148 | 144 |
149 virtual void cueDidChange() OVERRIDE; | 145 virtual void cueDidChange() OVERRIDE; |
150 | 146 |
151 void createVTTNodeTree(); | 147 void createVTTNodeTree(); |
152 void copyVTTNodeToDOMTree(ContainerNode* vttNode, ContainerNode* root); | 148 void copyVTTNodeToDOMTree(ContainerNode* vttNode, ContainerNode* root); |
153 | 149 |
154 std::pair<double, double> getPositionCoordinates() const; | 150 std::pair<double, double> getPositionCoordinates() const; |
155 | 151 |
156 void calculateDisplayParameters(); | 152 void calculateDisplayParameters(); |
157 | 153 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 190 |
195 inline VTTCue* toVTTCue(TextTrackCue* cue) | 191 inline VTTCue* toVTTCue(TextTrackCue* cue) |
196 { | 192 { |
197 // VTTCue is currently the only TextTrackCue subclass. | 193 // VTTCue is currently the only TextTrackCue subclass. |
198 return static_cast<VTTCue*>(cue); | 194 return static_cast<VTTCue*>(cue); |
199 } | 195 } |
200 | 196 |
201 } // namespace WebCore | 197 } // namespace WebCore |
202 | 198 |
203 #endif | 199 #endif |
OLD | NEW |