OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. |
3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 20 matching lines...) Expand all Loading... |
31 #define TextTrackContainer_h | 31 #define TextTrackContainer_h |
32 | 32 |
33 #include "core/html/HTMLDivElement.h" | 33 #include "core/html/HTMLDivElement.h" |
34 | 34 |
35 namespace blink { | 35 namespace blink { |
36 | 36 |
37 class HTMLMediaElement; | 37 class HTMLMediaElement; |
38 | 38 |
39 class TextTrackContainer final : public HTMLDivElement { | 39 class TextTrackContainer final : public HTMLDivElement { |
40 public: | 40 public: |
41 static TextTrackContainer* Create(Document&); | 41 static TextTrackContainer* Create(HTMLMediaElement&); |
42 | 42 |
43 // Runs the "rules for updating the text track rendering". The | 43 // Runs the "rules for updating the text track rendering". The |
44 // ExposingControls enum is used in the WebVTT processing model to reset the | 44 // ExposingControls enum is used in the WebVTT processing model to reset the |
45 // layout when the media controls become visible, to avoid overlapping them. | 45 // layout when the media controls become visible, to avoid overlapping them. |
46 enum ExposingControls { | 46 enum ExposingControls { |
47 kDidNotStartExposingControls, | 47 kDidNotStartExposingControls, |
48 kDidStartExposingControls | 48 kDidStartExposingControls |
49 }; | 49 }; |
50 void UpdateDisplay(HTMLMediaElement&, ExposingControls); | 50 void UpdateDisplay(HTMLMediaElement&, ExposingControls); |
| 51 void UpdateDefaultFontSize(LayoutObject*); |
| 52 |
| 53 DECLARE_VIRTUAL_TRACE(); |
51 | 54 |
52 private: | 55 private: |
53 TextTrackContainer(Document&); | 56 TextTrackContainer(Document&); |
54 | 57 |
55 bool IsTextTrackContainer() const override { return true; } | 58 bool IsTextTrackContainer() const override { return true; } |
| 59 void ObserveSizeChanges(Element&); |
56 | 60 |
57 LayoutObject* CreateLayoutObject(const ComputedStyle&) override; | 61 LayoutObject* CreateLayoutObject(const ComputedStyle&) override; |
| 62 |
| 63 Member<ResizeObserver> video_size_observer_; |
| 64 float default_font_size_; |
58 }; | 65 }; |
59 | 66 |
60 DEFINE_ELEMENT_TYPE_CASTS(TextTrackContainer, IsTextTrackContainer()); | 67 DEFINE_ELEMENT_TYPE_CASTS(TextTrackContainer, IsTextTrackContainer()); |
61 | 68 |
62 } // namespace blink | 69 } // namespace blink |
63 | 70 |
64 #endif // TextTrackContainer_h | 71 #endif // TextTrackContainer_h |
OLD | NEW |