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

Side by Side Diff: Source/core/accessibility/AccessibilityMediaControls.cpp

Issue 16081007: Introduce toHTMLInputElement(Node*), and use it. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple 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 * 7 *
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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 { 264 {
265 return adoptRef(new AccessibilityMediaTimeline(renderer)); 265 return adoptRef(new AccessibilityMediaTimeline(renderer));
266 } 266 }
267 267
268 String AccessibilityMediaTimeline::valueDescription() const 268 String AccessibilityMediaTimeline::valueDescription() const
269 { 269 {
270 Node* node = m_renderer->node(); 270 Node* node = m_renderer->node();
271 if (!node->hasTagName(inputTag)) 271 if (!node->hasTagName(inputTag))
272 return String(); 272 return String();
273 273
274 float time = static_cast<HTMLInputElement*>(node)->value().toFloat(); 274 return localizedMediaTimeDescription(toHTMLInputElement(node)->value().toFlo at());
275 return localizedMediaTimeDescription(time);
276 } 275 }
277 276
278 String AccessibilityMediaTimeline::helpText() const 277 String AccessibilityMediaTimeline::helpText() const
279 { 278 {
280 DEFINE_STATIC_LOCAL(const String, slider, (ASCIILiteral("Slider"))); 279 DEFINE_STATIC_LOCAL(const String, slider, (ASCIILiteral("Slider")));
281 return localizedMediaControlElementHelpText(slider); 280 return localizedMediaControlElementHelpText(slider);
282 } 281 }
283 282
284 283
285 // 284 //
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 { 320 {
322 if (!m_renderer || !m_renderer->node()) 321 if (!m_renderer || !m_renderer->node())
323 return String(); 322 return String();
324 323
325 MediaControlTimeDisplayElement* element = static_cast<MediaControlTimeDispla yElement*>(m_renderer->node()); 324 MediaControlTimeDisplayElement* element = static_cast<MediaControlTimeDispla yElement*>(m_renderer->node());
326 float time = element->currentValue(); 325 float time = element->currentValue();
327 return localizedMediaTimeDescription(fabsf(time)); 326 return localizedMediaTimeDescription(fabsf(time));
328 } 327 }
329 328
330 } // namespace WebCore 329 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebKit/chromium/src/WebViewImpl.cpp ('k') | Source/core/accessibility/AccessibilityNodeObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698