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 textTracksChanged(); | 62 void textTracksChanged(); |
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 IgnoreControlsHover = 1 << 2 | 91 IgnoreControlsHover = 1 << 2 |
87 }; | 92 }; |
88 | 93 |
89 bool shouldHideMediaControls(unsigned behaviorFlags = 0) const; | 94 bool shouldHideMediaControls(unsigned behaviorFlags = 0) const; |
90 void hideMediaControlsTimerFired(Timer<MediaControls>*); | 95 void hideMediaControlsTimerFired(Timer<MediaControls>*); |
91 void startHideMediaControlsTimer(); | 96 void startHideMediaControlsTimer(); |
92 void stopHideMediaControlsTimer(); | 97 void stopHideMediaControlsTimer(); |
| 98 void resetHideMediaControlsTimer(); |
93 | 99 |
94 void createTextTrackDisplay(); | 100 void createTextTrackDisplay(); |
95 void showTextTrackDisplay(); | 101 void showTextTrackDisplay(); |
96 void hideTextTrackDisplay(); | 102 void hideTextTrackDisplay(); |
97 | 103 |
98 // Node | 104 // Node |
99 virtual bool isMediaControls() const OVERRIDE { return true; } | 105 virtual bool isMediaControls() const OVERRIDE { return true; } |
100 virtual bool willRespondToMouseMoveEvents() OVERRIDE { return true; } | 106 virtual bool willRespondToMouseMoveEvents() OVERRIDE { return true; } |
101 virtual void defaultEventHandler(Event*) OVERRIDE; | 107 virtual void defaultEventHandler(Event*) OVERRIDE; |
102 bool containsRelatedTarget(Event*); | 108 bool containsRelatedTarget(Event*); |
(...skipping 12 matching lines...) Expand all Loading... |
115 // Media control elements. | 121 // Media control elements. |
116 RawPtrWillBeMember<MediaControlOverlayPlayButtonElement> m_overlayPlayButton
; | 122 RawPtrWillBeMember<MediaControlOverlayPlayButtonElement> m_overlayPlayButton
; |
117 RawPtrWillBeMember<MediaControlOverlayEnclosureElement> m_overlayEnclosure; | 123 RawPtrWillBeMember<MediaControlOverlayEnclosureElement> m_overlayEnclosure; |
118 RawPtrWillBeMember<MediaControlPlayButtonElement> m_playButton; | 124 RawPtrWillBeMember<MediaControlPlayButtonElement> m_playButton; |
119 RawPtrWillBeMember<MediaControlCurrentTimeDisplayElement> m_currentTimeDispl
ay; | 125 RawPtrWillBeMember<MediaControlCurrentTimeDisplayElement> m_currentTimeDispl
ay; |
120 RawPtrWillBeMember<MediaControlTimelineElement> m_timeline; | 126 RawPtrWillBeMember<MediaControlTimelineElement> m_timeline; |
121 RawPtrWillBeMember<MediaControlMuteButtonElement> m_muteButton; | 127 RawPtrWillBeMember<MediaControlMuteButtonElement> m_muteButton; |
122 RawPtrWillBeMember<MediaControlVolumeSliderElement> m_volumeSlider; | 128 RawPtrWillBeMember<MediaControlVolumeSliderElement> m_volumeSlider; |
123 RawPtrWillBeMember<MediaControlToggleClosedCaptionsButtonElement> m_toggleCl
osedCaptionsButton; | 129 RawPtrWillBeMember<MediaControlToggleClosedCaptionsButtonElement> m_toggleCl
osedCaptionsButton; |
124 RawPtrWillBeMember<MediaControlFullscreenButtonElement> m_fullScreenButton; | 130 RawPtrWillBeMember<MediaControlFullscreenButtonElement> m_fullScreenButton; |
| 131 RawPtrWillBeMember<MediaControlCastButtonElement> m_castButton; |
| 132 RawPtrWillBeMember<MediaControlCastButtonElement> m_overlayCastButton; |
125 RawPtrWillBeMember<MediaControlTimeRemainingDisplayElement> m_durationDispla
y; | 133 RawPtrWillBeMember<MediaControlTimeRemainingDisplayElement> m_durationDispla
y; |
126 RawPtrWillBeMember<MediaControlPanelEnclosureElement> m_enclosure; | 134 RawPtrWillBeMember<MediaControlPanelEnclosureElement> m_enclosure; |
127 | 135 |
128 Timer<MediaControls> m_hideMediaControlsTimer; | 136 Timer<MediaControls> m_hideMediaControlsTimer; |
129 bool m_isMouseOverControls : 1; | 137 bool m_isMouseOverControls : 1; |
130 bool m_isPausedForScrubbing : 1; | 138 bool m_isPausedForScrubbing : 1; |
131 bool m_wasLastEventTouch : 1; | 139 bool m_wasLastEventTouch : 1; |
132 }; | 140 }; |
133 | 141 |
134 DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls()); | 142 DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls()); |
135 | 143 |
136 } | 144 } |
137 | 145 |
138 #endif | 146 #endif |
OLD | NEW |