| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 void updateVolume(); | 58 void updateVolume(); |
| 59 | 59 |
| 60 void changedClosedCaptionsVisibility(); | 60 void changedClosedCaptionsVisibility(); |
| 61 void refreshClosedCaptionsButtonVisibility(); | 61 void refreshClosedCaptionsButtonVisibility(); |
| 62 void closedCaptionTracksChanged(); | 62 void closedCaptionTracksChanged(); |
| 63 | 63 |
| 64 void enteredFullscreen(); | 64 void enteredFullscreen(); |
| 65 void exitedFullscreen(); | 65 void exitedFullscreen(); |
| 66 | 66 |
| 67 void startedCasting(); |
| 68 void stoppedCasting(); |
| 69 void refreshCastButtonVisibility(); |
| 70 void showOverlayCastButton(); |
| 71 |
| 67 void updateTextTrackDisplay(); | 72 void updateTextTrackDisplay(); |
| 68 | 73 |
| 69 void mediaElementFocused(); | 74 void mediaElementFocused(); |
| 70 | 75 |
| 71 virtual void trace(Visitor*) OVERRIDE; | 76 virtual void trace(Visitor*) OVERRIDE; |
| 72 | 77 |
| 73 private: | 78 private: |
| 74 explicit MediaControls(HTMLMediaElement&); | 79 explicit MediaControls(HTMLMediaElement&); |
| 75 | 80 |
| 76 bool initializeControls(); | 81 bool initializeControls(); |
| 77 | 82 |
| 78 void makeOpaque(); | 83 void makeOpaque(); |
| 79 void makeTransparent(); | 84 void makeTransparent(); |
| 80 | 85 |
| 81 void updatePlayState(); | 86 void updatePlayState(); |
| 82 | 87 |
| 83 enum HideBehaviorFlags { | 88 enum HideBehaviorFlags { |
| 84 IgnoreVideoHover = 1 << 0, | 89 IgnoreVideoHover = 1 << 0, |
| 85 IgnoreFocus = 1 << 1 | 90 IgnoreFocus = 1 << 1 |
| 86 }; | 91 }; |
| 87 | 92 |
| 88 bool shouldHideMediaControls(unsigned behaviorFlags = 0) const; | 93 bool shouldHideMediaControls(unsigned behaviorFlags = 0) const; |
| 89 void hideMediaControlsTimerFired(Timer<MediaControls>*); | 94 void hideMediaControlsTimerFired(Timer<MediaControls>*); |
| 90 void startHideMediaControlsTimer(); | 95 void startHideMediaControlsTimer(); |
| 91 void stopHideMediaControlsTimer(); | 96 void stopHideMediaControlsTimer(); |
| 97 void resetHideMediaControlsTimer(); |
| 92 | 98 |
| 93 void createTextTrackDisplay(); | 99 void createTextTrackDisplay(); |
| 94 void showTextTrackDisplay(); | 100 void showTextTrackDisplay(); |
| 95 void hideTextTrackDisplay(); | 101 void hideTextTrackDisplay(); |
| 96 | 102 |
| 97 // Node | 103 // Node |
| 98 virtual bool isMediaControls() const OVERRIDE { return true; } | 104 virtual bool isMediaControls() const OVERRIDE { return true; } |
| 99 virtual bool willRespondToMouseMoveEvents() OVERRIDE { return true; } | 105 virtual bool willRespondToMouseMoveEvents() OVERRIDE { return true; } |
| 100 virtual void defaultEventHandler(Event*) OVERRIDE; | 106 virtual void defaultEventHandler(Event*) OVERRIDE; |
| 101 bool containsRelatedTarget(Event*); | 107 bool containsRelatedTarget(Event*); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 114 // Media control elements. | 120 // Media control elements. |
| 115 RawPtrWillBeMember<MediaControlOverlayPlayButtonElement> m_overlayPlayButton
; | 121 RawPtrWillBeMember<MediaControlOverlayPlayButtonElement> m_overlayPlayButton
; |
| 116 RawPtrWillBeMember<MediaControlOverlayEnclosureElement> m_overlayEnclosure; | 122 RawPtrWillBeMember<MediaControlOverlayEnclosureElement> m_overlayEnclosure; |
| 117 RawPtrWillBeMember<MediaControlPlayButtonElement> m_playButton; | 123 RawPtrWillBeMember<MediaControlPlayButtonElement> m_playButton; |
| 118 RawPtrWillBeMember<MediaControlCurrentTimeDisplayElement> m_currentTimeDispl
ay; | 124 RawPtrWillBeMember<MediaControlCurrentTimeDisplayElement> m_currentTimeDispl
ay; |
| 119 RawPtrWillBeMember<MediaControlTimelineElement> m_timeline; | 125 RawPtrWillBeMember<MediaControlTimelineElement> m_timeline; |
| 120 RawPtrWillBeMember<MediaControlMuteButtonElement> m_muteButton; | 126 RawPtrWillBeMember<MediaControlMuteButtonElement> m_muteButton; |
| 121 RawPtrWillBeMember<MediaControlVolumeSliderElement> m_volumeSlider; | 127 RawPtrWillBeMember<MediaControlVolumeSliderElement> m_volumeSlider; |
| 122 RawPtrWillBeMember<MediaControlToggleClosedCaptionsButtonElement> m_toggleCl
osedCaptionsButton; | 128 RawPtrWillBeMember<MediaControlToggleClosedCaptionsButtonElement> m_toggleCl
osedCaptionsButton; |
| 123 RawPtrWillBeMember<MediaControlFullscreenButtonElement> m_fullScreenButton; | 129 RawPtrWillBeMember<MediaControlFullscreenButtonElement> m_fullScreenButton; |
| 130 RawPtrWillBeMember<MediaControlCastButtonElement> m_castButton; |
| 131 RawPtrWillBeMember<MediaControlCastButtonElement> m_overlayCastButton; |
| 124 RawPtrWillBeMember<MediaControlTimeRemainingDisplayElement> m_durationDispla
y; | 132 RawPtrWillBeMember<MediaControlTimeRemainingDisplayElement> m_durationDispla
y; |
| 125 RawPtrWillBeMember<MediaControlPanelEnclosureElement> m_enclosure; | 133 RawPtrWillBeMember<MediaControlPanelEnclosureElement> m_enclosure; |
| 126 | 134 |
| 127 Timer<MediaControls> m_hideMediaControlsTimer; | 135 Timer<MediaControls> m_hideMediaControlsTimer; |
| 128 bool m_isMouseOverControls : 1; | 136 bool m_isMouseOverControls : 1; |
| 129 bool m_isPausedForScrubbing : 1; | 137 bool m_isPausedForScrubbing : 1; |
| 130 }; | 138 }; |
| 131 | 139 |
| 132 DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls()); | 140 DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls()); |
| 133 | 141 |
| 134 } | 142 } |
| 135 | 143 |
| 136 #endif | 144 #endif |
| OLD | NEW |