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 void MediaControls::refreshClosedCaptionsButtonVisibility() | 349 void MediaControls::refreshClosedCaptionsButtonVisibility() |
350 { | 350 { |
351 if (mediaElement().hasClosedCaptions()) | 351 if (mediaElement().hasClosedCaptions()) |
352 m_toggleClosedCaptionsButton->show(); | 352 m_toggleClosedCaptionsButton->show(); |
353 else | 353 else |
354 m_toggleClosedCaptionsButton->hide(); | 354 m_toggleClosedCaptionsButton->hide(); |
355 } | 355 } |
356 | 356 |
357 static Element* elementFromCenter(Element& element) | 357 static Element* elementFromCenter(Element& element) |
358 { | 358 { |
359 RefPtrWillBeRawPtr<ClientRect> clientRect = element.getBoundingClientRect(); | 359 ClientRect* clientRect = element.getBoundingClientRect(); |
360 int centerX = static_cast<int>((clientRect->left() + clientRect->right()) /
2); | 360 int centerX = static_cast<int>((clientRect->left() + clientRect->right()) /
2); |
361 int centerY = static_cast<int>((clientRect->top() + clientRect->bottom()) /
2); | 361 int centerY = static_cast<int>((clientRect->top() + clientRect->bottom()) /
2); |
362 | 362 |
363 return element.document().elementFromPoint(centerX , centerY); | 363 return element.document().elementFromPoint(centerX , centerY); |
364 } | 364 } |
365 | 365 |
366 void MediaControls::tryShowOverlayCastButton() | 366 void MediaControls::tryShowOverlayCastButton() |
367 { | 367 { |
368 // The element needs to be shown to have its dimensions and position. | 368 // The element needs to be shown to have its dimensions and position. |
369 m_overlayCastButton->show(); | 369 m_overlayCastButton->show(); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 visitor->trace(m_toggleClosedCaptionsButton); | 529 visitor->trace(m_toggleClosedCaptionsButton); |
530 visitor->trace(m_fullScreenButton); | 530 visitor->trace(m_fullScreenButton); |
531 visitor->trace(m_durationDisplay); | 531 visitor->trace(m_durationDisplay); |
532 visitor->trace(m_enclosure); | 532 visitor->trace(m_enclosure); |
533 visitor->trace(m_castButton); | 533 visitor->trace(m_castButton); |
534 visitor->trace(m_overlayCastButton); | 534 visitor->trace(m_overlayCastButton); |
535 HTMLDivElement::trace(visitor); | 535 HTMLDivElement::trace(visitor); |
536 } | 536 } |
537 | 537 |
538 } | 538 } |
OLD | NEW |