OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. |
3 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2011, 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 * 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 } | 349 } |
350 | 350 |
351 void MediaControls::refreshClosedCaptionsButtonVisibility() | 351 void MediaControls::refreshClosedCaptionsButtonVisibility() |
352 { | 352 { |
353 if (mediaElement().hasClosedCaptions()) | 353 if (mediaElement().hasClosedCaptions()) |
354 m_toggleClosedCaptionsButton->show(); | 354 m_toggleClosedCaptionsButton->show(); |
355 else | 355 else |
356 m_toggleClosedCaptionsButton->hide(); | 356 m_toggleClosedCaptionsButton->hide(); |
357 } | 357 } |
358 | 358 |
359 void MediaControls::textTracksChanged() | |
360 { | |
361 refreshClosedCaptionsButtonVisibility(); | |
362 } | |
363 | |
364 static Element* elementFromCenter(Element& element) | 359 static Element* elementFromCenter(Element& element) |
365 { | 360 { |
366 RefPtrWillBeRawPtr<ClientRect> clientRect = element.getBoundingClientRect(); | 361 RefPtrWillBeRawPtr<ClientRect> clientRect = element.getBoundingClientRect(); |
367 int centerX = static_cast<int>((clientRect->left() + clientRect->right()) /
2); | 362 int centerX = static_cast<int>((clientRect->left() + clientRect->right()) /
2); |
368 int centerY = static_cast<int>((clientRect->top() + clientRect->bottom()) /
2); | 363 int centerY = static_cast<int>((clientRect->top() + clientRect->bottom()) /
2); |
369 | 364 |
370 return element.document().elementFromPoint(centerX , centerY); | 365 return element.document().elementFromPoint(centerX , centerY); |
371 } | 366 } |
372 | 367 |
373 void MediaControls::tryShowOverlayCastButton() | 368 void MediaControls::tryShowOverlayCastButton() |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 visitor->trace(m_toggleClosedCaptionsButton); | 566 visitor->trace(m_toggleClosedCaptionsButton); |
572 visitor->trace(m_fullScreenButton); | 567 visitor->trace(m_fullScreenButton); |
573 visitor->trace(m_durationDisplay); | 568 visitor->trace(m_durationDisplay); |
574 visitor->trace(m_enclosure); | 569 visitor->trace(m_enclosure); |
575 visitor->trace(m_castButton); | 570 visitor->trace(m_castButton); |
576 visitor->trace(m_overlayCastButton); | 571 visitor->trace(m_overlayCastButton); |
577 HTMLDivElement::trace(visitor); | 572 HTMLDivElement::trace(visitor); |
578 } | 573 } |
579 | 574 |
580 } | 575 } |
OLD | NEW |