Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Side by Side Diff: third_party/WebKit/Source/core/html/track/TextTrack.h

Issue 1079323002: Support text track selection in video controls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and Philip's comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2011, 2012, 2013 Apple 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 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 DEFINE_WRAPPERTYPEINFO(); 49 DEFINE_WRAPPERTYPEINFO();
50 USING_GARBAGE_COLLECTED_MIXIN(TextTrack); 50 USING_GARBAGE_COLLECTED_MIXIN(TextTrack);
51 public: 51 public:
52 static TextTrack* create(const AtomicString& kind, const AtomicString& label , const AtomicString& language) 52 static TextTrack* create(const AtomicString& kind, const AtomicString& label , const AtomicString& language)
53 { 53 {
54 return new TextTrack(kind, label, language, emptyAtom, AddTrack); 54 return new TextTrack(kind, label, language, emptyAtom, AddTrack);
55 } 55 }
56 ~TextTrack() override; 56 ~TextTrack() override;
57 57
58 virtual void setTrackList(TextTrackList*); 58 virtual void setTrackList(TextTrackList*);
59 TextTrackList* trackList() { return m_trackList; } 59 TextTrackList* trackList() const { return m_trackList; }
60 60
61 void setKind(const AtomicString&) override; 61 void setKind(const AtomicString&) override;
62 62
63 static const AtomicString& subtitlesKeyword(); 63 static const AtomicString& subtitlesKeyword();
64 static const AtomicString& captionsKeyword(); 64 static const AtomicString& captionsKeyword();
65 static const AtomicString& descriptionsKeyword(); 65 static const AtomicString& descriptionsKeyword();
66 static const AtomicString& chaptersKeyword(); 66 static const AtomicString& chaptersKeyword();
67 static const AtomicString& metadataKeyword(); 67 static const AtomicString& metadataKeyword();
68 static bool isValidKindKeyword(const String&); 68 static bool isValidKindKeyword(const String&);
69 69
(...skipping 25 matching lines...) Expand all
95 void cueDidChange(TextTrackCue*); 95 void cueDidChange(TextTrackCue*);
96 96
97 DEFINE_ATTRIBUTE_EVENT_LISTENER(cuechange); 97 DEFINE_ATTRIBUTE_EVENT_LISTENER(cuechange);
98 98
99 enum TextTrackType { TrackElement, AddTrack, InBand }; 99 enum TextTrackType { TrackElement, AddTrack, InBand };
100 TextTrackType trackType() const { return m_trackType; } 100 TextTrackType trackType() const { return m_trackType; }
101 101
102 int trackIndex(); 102 int trackIndex();
103 void invalidateTrackIndex(); 103 void invalidateTrackIndex();
104 104
105 bool isRendered(); 105 bool isRendered() const;
106 bool canBeRendered() const;
106 int trackIndexRelativeToRenderedTracks(); 107 int trackIndexRelativeToRenderedTracks();
107 108
108 bool hasBeenConfigured() const { return m_hasBeenConfigured; } 109 bool hasBeenConfigured() const { return m_hasBeenConfigured; }
109 void setHasBeenConfigured(bool flag) { m_hasBeenConfigured = flag; } 110 void setHasBeenConfigured(bool flag) { m_hasBeenConfigured = flag; }
110 111
111 virtual bool isDefault() const { return false; } 112 virtual bool isDefault() const { return false; }
112 113
113 void removeAllCues(); 114 void removeAllCues();
114 115
115 // EventTarget methods 116 // EventTarget methods
(...skipping 27 matching lines...) Expand all
143 int m_trackIndex; 144 int m_trackIndex;
144 int m_renderedTrackIndex; 145 int m_renderedTrackIndex;
145 bool m_hasBeenConfigured; 146 bool m_hasBeenConfigured;
146 }; 147 };
147 148
148 DEFINE_TRACK_TYPE_CASTS(TextTrack, WebMediaPlayer::TextTrack); 149 DEFINE_TRACK_TYPE_CASTS(TextTrack, WebMediaPlayer::TextTrack);
149 150
150 } // namespace blink 151 } // namespace blink
151 152
152 #endif // TextTrack_h 153 #endif // TextTrack_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698