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

Side by Side Diff: third_party/WebKit/Source/core/html/shadow/MediaControlElements.h

Issue 1079323002: Support text track selection in video controls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed UX comment on displaying icons only for duplicate labels and rebase 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) 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 16 matching lines...) Expand all
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 28 */
29 29
30 #ifndef MediaControlElements_h 30 #ifndef MediaControlElements_h
31 #define MediaControlElements_h 31 #define MediaControlElements_h
32 32
33 #include "core/html/shadow/MediaControlElementTypes.h" 33 #include "core/html/shadow/MediaControlElementTypes.h"
34 34
35 namespace blink { 35 namespace blink {
36 36
37 class TextTrack;
38
37 // ---------------------------- 39 // ----------------------------
38 40
39 class MediaControlPanelElement final : public MediaControlDivElement { 41 class MediaControlPanelElement final : public MediaControlDivElement {
40 public: 42 public:
41 static RawPtr<MediaControlPanelElement> create(MediaControls&); 43 static RawPtr<MediaControlPanelElement> create(MediaControls&);
42 44
43 void setIsDisplayed(bool); 45 void setIsDisplayed(bool);
44 46
45 void makeOpaque(); 47 void makeOpaque();
46 void makeTransparent(); 48 void makeTransparent();
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 void updateDisplayType() override; 141 void updateDisplayType() override;
140 142
141 private: 143 private:
142 explicit MediaControlToggleClosedCaptionsButtonElement(MediaControls&); 144 explicit MediaControlToggleClosedCaptionsButtonElement(MediaControls&);
143 145
144 void defaultEventHandler(Event*) override; 146 void defaultEventHandler(Event*) override;
145 }; 147 };
146 148
147 // ---------------------------- 149 // ----------------------------
148 150
151 class MediaControlTextTrackListElement final : public MediaControlDivElement {
152 public:
153 static RawPtr<MediaControlTextTrackListElement> create(MediaControls&);
154
155 bool willRespondToMouseClickEvents() override { return true; }
156
157 void setVisible(bool);
158
159 private:
160 explicit MediaControlTextTrackListElement(MediaControls&);
161
162 void defaultEventHandler(Event*) override;
163
164 void refreshTextTrackListMenu();
165
166 bool shouldDisplayTrackKindMarker(TextTrack*, String);
167 // Returns the label for the track when a valid track is passed in and "Off" when the parameter is null.
168 String getTextTrackLabel(TextTrack*);
169 // Creates the track element in the list when a valid track is passed in and the "Off" item when the parameter is null.
170 RawPtr<Element> createTextTrackListItem(TextTrack*);
171
172 void showTextTrackAtIndex(unsigned);
173 void disableShowingTextTracks();
174 };
175
176 // ----------------------------
177
149 class MediaControlTimelineElement final : public MediaControlInputElement { 178 class MediaControlTimelineElement final : public MediaControlInputElement {
150 public: 179 public:
151 static RawPtr<MediaControlTimelineElement> create(MediaControls&); 180 static RawPtr<MediaControlTimelineElement> create(MediaControls&);
152 181
153 bool willRespondToMouseClickEvents() override; 182 bool willRespondToMouseClickEvents() override;
154 183
155 // FIXME: An "earliest possible position" will be needed once that concept 184 // FIXME: An "earliest possible position" will be needed once that concept
156 // is supported by HTMLMediaElement, see https://crbug.com/137275 185 // is supported by HTMLMediaElement, see https://crbug.com/137275
157 void setPosition(double); 186 void setPosition(double);
158 void setDuration(double); 187 void setDuration(double);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 public: 281 public:
253 static RawPtr<MediaControlCurrentTimeDisplayElement> create(MediaControls&); 282 static RawPtr<MediaControlCurrentTimeDisplayElement> create(MediaControls&);
254 283
255 private: 284 private:
256 explicit MediaControlCurrentTimeDisplayElement(MediaControls&); 285 explicit MediaControlCurrentTimeDisplayElement(MediaControls&);
257 }; 286 };
258 287
259 } // namespace blink 288 } // namespace blink
260 289
261 #endif // MediaControlElements_h 290 #endif // MediaControlElements_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698