OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. |
3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 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 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 void MediaControlFullscreenButtonElement::setIsFullscreen(bool isFullscreen) | 563 void MediaControlFullscreenButtonElement::setIsFullscreen(bool isFullscreen) |
564 { | 564 { |
565 setDisplayType(isFullscreen ? MediaExitFullscreenButton : MediaEnterFullscre
enButton); | 565 setDisplayType(isFullscreen ? MediaExitFullscreenButton : MediaEnterFullscre
enButton); |
566 } | 566 } |
567 | 567 |
568 // ---------------------------- | 568 // ---------------------------- |
569 | 569 |
570 MediaControlCastButtonElement::MediaControlCastButtonElement(MediaControls& medi
aControls, bool isOverlayButton) | 570 MediaControlCastButtonElement::MediaControlCastButtonElement(MediaControls& medi
aControls, bool isOverlayButton) |
571 : MediaControlInputElement(mediaControls, MediaCastOnButton), m_isOverlayBut
ton(isOverlayButton) | 571 : MediaControlInputElement(mediaControls, MediaCastOnButton), m_isOverlayBut
ton(isOverlayButton) |
572 { | 572 { |
| 573 setIsPlayingRemotely(false); |
573 } | 574 } |
574 | 575 |
575 PassRefPtrWillBeRawPtr<MediaControlCastButtonElement> MediaControlCastButtonElem
ent::create(MediaControls& mediaControls, bool isOverlayButton) | 576 PassRefPtrWillBeRawPtr<MediaControlCastButtonElement> MediaControlCastButtonElem
ent::create(MediaControls& mediaControls, bool isOverlayButton) |
576 { | 577 { |
577 RefPtrWillBeRawPtr<MediaControlCastButtonElement> button = adoptRefWillBeNoo
p(new MediaControlCastButtonElement(mediaControls, isOverlayButton)); | 578 RefPtrWillBeRawPtr<MediaControlCastButtonElement> button = adoptRefWillBeNoo
p(new MediaControlCastButtonElement(mediaControls, isOverlayButton)); |
578 button->ensureUserAgentShadowRoot(); | 579 button->ensureUserAgentShadowRoot(); |
579 button->setType("button"); | 580 button->setType("button"); |
580 return button.release(); | 581 return button.release(); |
581 } | 582 } |
582 | 583 |
(...skipping 11 matching lines...) Expand all Loading... |
594 | 595 |
595 const AtomicString& MediaControlCastButtonElement::shadowPseudoId() const | 596 const AtomicString& MediaControlCastButtonElement::shadowPseudoId() const |
596 { | 597 { |
597 DEFINE_STATIC_LOCAL(AtomicString, id_nonOverlay, ("-internal-media-controls-
cast-button", AtomicString::ConstructFromLiteral)); | 598 DEFINE_STATIC_LOCAL(AtomicString, id_nonOverlay, ("-internal-media-controls-
cast-button", AtomicString::ConstructFromLiteral)); |
598 DEFINE_STATIC_LOCAL(AtomicString, id_overlay, ("-internal-media-controls-ove
rlay-cast-button", AtomicString::ConstructFromLiteral)); | 599 DEFINE_STATIC_LOCAL(AtomicString, id_overlay, ("-internal-media-controls-ove
rlay-cast-button", AtomicString::ConstructFromLiteral)); |
599 return m_isOverlayButton ? id_overlay : id_nonOverlay; | 600 return m_isOverlayButton ? id_overlay : id_nonOverlay; |
600 } | 601 } |
601 | 602 |
602 void MediaControlCastButtonElement::setIsPlayingRemotely(bool isPlayingRemotely) | 603 void MediaControlCastButtonElement::setIsPlayingRemotely(bool isPlayingRemotely) |
603 { | 604 { |
604 setDisplayType(isPlayingRemotely ? MediaCastOnButton : MediaCastOffButton); | 605 if (isPlayingRemotely) { |
| 606 if (m_isOverlayButton) { |
| 607 setDisplayType(MediaOverlayCastOnButton); |
| 608 } else { |
| 609 setDisplayType(MediaCastOnButton); |
| 610 } |
| 611 } else { |
| 612 if (m_isOverlayButton) { |
| 613 setDisplayType(MediaOverlayCastOffButton); |
| 614 } else { |
| 615 setDisplayType(MediaCastOffButton); |
| 616 } |
| 617 } |
605 } | 618 } |
606 | 619 |
607 bool MediaControlCastButtonElement::keepEventInNode(Event* event) | 620 bool MediaControlCastButtonElement::keepEventInNode(Event* event) |
608 { | 621 { |
609 return isUserInteractionEvent(event); | 622 return isUserInteractionEvent(event); |
610 } | 623 } |
611 | 624 |
612 // ---------------------------- | 625 // ---------------------------- |
613 | 626 |
614 MediaControlTimeRemainingDisplayElement::MediaControlTimeRemainingDisplayElement
(MediaControls& mediaControls) | 627 MediaControlTimeRemainingDisplayElement::MediaControlTimeRemainingDisplayElement
(MediaControls& mediaControls) |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 float fontSize = smallestDimension * 0.05f; | 786 float fontSize = smallestDimension * 0.05f; |
774 if (fontSize != m_fontSize) { | 787 if (fontSize != m_fontSize) { |
775 m_fontSize = fontSize; | 788 m_fontSize = fontSize; |
776 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue:
:CSS_PX); | 789 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue:
:CSS_PX); |
777 } | 790 } |
778 } | 791 } |
779 | 792 |
780 // ---------------------------- | 793 // ---------------------------- |
781 | 794 |
782 } // namespace blink | 795 } // namespace blink |
OLD | NEW |