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

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

Issue 361563003: Remove unneeded and incorrect static_cast in AXMediaControlsContainer::controllingVideoElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: removed static_cast Created 6 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 return queryString(controllingVideoElement() ? WebLocalizedString::AXMediaVi deoElement : WebLocalizedString::AXMediaAudioElement); 201 return queryString(controllingVideoElement() ? WebLocalizedString::AXMediaVi deoElement : WebLocalizedString::AXMediaAudioElement);
202 } 202 }
203 203
204 String AXMediaControlsContainer::helpText() const 204 String AXMediaControlsContainer::helpText() const
205 { 205 {
206 return queryString(controllingVideoElement() ? WebLocalizedString::AXMediaVi deoElementHelp : WebLocalizedString::AXMediaAudioElementHelp); 206 return queryString(controllingVideoElement() ? WebLocalizedString::AXMediaVi deoElementHelp : WebLocalizedString::AXMediaAudioElementHelp);
207 } 207 }
208 208
209 bool AXMediaControlsContainer::controllingVideoElement() const 209 bool AXMediaControlsContainer::controllingVideoElement() const
210 { 210 {
211 if (!m_renderer->node()) 211 Node* node = m_renderer->node();
212 if (!node)
212 return true; 213 return true;
213 214
214 MediaControlTimeDisplayElement* element = static_cast<MediaControlTimeDispla yElement*>(m_renderer->node()); 215 return isHTMLVideoElement(toParentMediaElement(node));
215
216 return isHTMLVideoElement(toParentMediaElement(element));
217 } 216 }
218 217
219 bool AXMediaControlsContainer::computeAccessibilityIsIgnored() const 218 bool AXMediaControlsContainer::computeAccessibilityIsIgnored() const
220 { 219 {
221 return accessibilityIsIgnoredByDefault(); 220 return accessibilityIsIgnoredByDefault();
222 } 221 }
223 222
224 // 223 //
225 // AccessibilityMediaTimeline 224 // AccessibilityMediaTimeline
226 225
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 { 290 {
292 if (!m_renderer || !m_renderer->node()) 291 if (!m_renderer || !m_renderer->node())
293 return String(); 292 return String();
294 293
295 MediaControlTimeDisplayElement* element = static_cast<MediaControlTimeDispla yElement*>(m_renderer->node()); 294 MediaControlTimeDisplayElement* element = static_cast<MediaControlTimeDispla yElement*>(m_renderer->node());
296 float time = element->currentValue(); 295 float time = element->currentValue();
297 return localizedMediaTimeDescription(fabsf(time)); 296 return localizedMediaTimeDescription(fabsf(time));
298 } 297 }
299 298
300 } // namespace WebCore 299 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698