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

Side by Side Diff: Source/core/html/HTMLTrackElement.cpp

Issue 60633004: Remove WebInbandTextTrack::isDefault() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@unusedtrack
Patch Set: remove more Created 7 years, 1 month 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 * 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 String HTMLTrackElement::label() const 139 String HTMLTrackElement::label() const
140 { 140 {
141 return getAttribute(labelAttr); 141 return getAttribute(labelAttr);
142 } 142 }
143 143
144 void HTMLTrackElement::setLabel(const String& label) 144 void HTMLTrackElement::setLabel(const String& label)
145 { 145 {
146 setAttribute(labelAttr, label); 146 setAttribute(labelAttr, label);
147 } 147 }
148 148
149 bool HTMLTrackElement::isDefault() const
150 {
151 return fastHasAttribute(defaultAttr);
152 }
153
154 void HTMLTrackElement::setIsDefault(bool isDefault)
155 {
156 setBooleanAttribute(defaultAttr, isDefault);
157 }
158
159 LoadableTextTrack* HTMLTrackElement::ensureTrack() 149 LoadableTextTrack* HTMLTrackElement::ensureTrack()
160 { 150 {
161 if (!m_track) { 151 if (!m_track) {
162 // The kind attribute is an enumerated attribute, limited only to know v alues. It defaults to 'subtitles' if missing or invalid. 152 // The kind attribute is an enumerated attribute, limited only to know v alues. It defaults to 'subtitles' if missing or invalid.
163 String kind = getAttribute(kindAttr).lower(); 153 String kind = getAttribute(kindAttr).lower();
164 if (!TextTrack::isValidKindKeyword(kind)) 154 if (!TextTrack::isValidKindKeyword(kind))
165 kind = TextTrack::subtitlesKeyword(); 155 kind = TextTrack::subtitlesKeyword();
166 m_track = LoadableTextTrack::create(this, kind, label(), srclang()); 156 m_track = LoadableTextTrack::create(this, kind, label(), srclang());
167 } 157 }
168 return m_track.get(); 158 return m_track.get();
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 HTMLMediaElement* HTMLTrackElement::mediaElement() const 337 HTMLMediaElement* HTMLTrackElement::mediaElement() const
348 { 338 {
349 Element* parent = parentElement(); 339 Element* parent = parentElement();
350 if (parent && parent->isMediaElement()) 340 if (parent && parent->isMediaElement())
351 return toHTMLMediaElement(parentNode()); 341 return toHTMLMediaElement(parentNode());
352 return 0; 342 return 0;
353 } 343 }
354 344
355 } 345 }
356 346
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTrackElement.h ('k') | Source/platform/graphics/media/InbandTextTrackPrivate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698