Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.h

Issue 2805013003: Move MediaControlsMediaEventListener to modules/media_controls/. (Closed)
Patch Set: rebase after blink renaming Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 void ExitFullscreen() override; 98 void ExitFullscreen() override;
99 void ShowOverlayCastButtonIfNeeded() override; 99 void ShowOverlayCastButtonIfNeeded() override;
100 void ToggleOverflowMenu() override; 100 void ToggleOverflowMenu() override;
101 bool OverflowMenuVisible() override; 101 bool OverflowMenuVisible() override;
102 // TODO(mlamouri): this method is needed in order to notify the controls that 102 // TODO(mlamouri): this method is needed in order to notify the controls that
103 // the `MediaControlsEnabled` setting has changed. 103 // the `MediaControlsEnabled` setting has changed.
104 void OnMediaControlsEnabledChange() override { 104 void OnMediaControlsEnabledChange() override {
105 // There is no update because only the overlay is expected to change. 105 // There is no update because only the overlay is expected to change.
106 RefreshCastButtonVisibilityWithoutUpdate(); 106 RefreshCastButtonVisibilityWithoutUpdate();
107 } 107 }
108 // Methods called by MediaControlsMediaEventListener.
109 void OnVolumeChange() override;
110 void OnFocusIn() override;
111 void OnTimeUpdate() override;
112 void OnDurationChange() override;
113 void OnPlay() override;
114 void OnPlaying() override;
115 void OnPause() override;
116 void OnTextTracksAddedOrRemoved() override;
117 void OnTextTracksChanged() override;
118 void OnError() override;
119 void OnLoadedMetadata() override;
120 void OnEnteredFullscreen() override;
121 void OnExitedFullscreen() override;
122 void OnPanelKeypress() override;
123 Document& OwnerDocument() { return GetDocument(); } 108 Document& OwnerDocument() { return GetDocument(); }
124 109
125 DECLARE_VIRTUAL_TRACE(); 110 DECLARE_VIRTUAL_TRACE();
126 111
127 private: 112 private:
128 // MediaControlsMediaEventListener is a component that is listening to events 113 // MediaControlsMediaEventListener is a component that is listening to events
129 // and calling the appropriate callback on MediaControlsImpl. The object is 114 // and calling the appropriate callback on MediaControlsImpl. The object is
130 // split from MedaiControlsImpl to reduce boilerplate and ease reading. In 115 // split from MedaiControlsImpl to reduce boilerplate and ease reading. In
131 // order to not expose accessors only for this component, a friendship is 116 // order to not expose accessors only for this component, a friendship is
132 // declared. 117 // declared.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 bool WillRespondToMouseMoveEvents() override { return true; } 173 bool WillRespondToMouseMoveEvents() override { return true; }
189 void DefaultEventHandler(Event*) override; 174 void DefaultEventHandler(Event*) override;
190 bool ContainsRelatedTarget(Event*); 175 bool ContainsRelatedTarget(Event*);
191 176
192 // Internal cast related methods. 177 // Internal cast related methods.
193 void StartedCasting(); 178 void StartedCasting();
194 void StoppedCasting(); 179 void StoppedCasting();
195 void RefreshCastButtonVisibility(); 180 void RefreshCastButtonVisibility();
196 void RefreshCastButtonVisibilityWithoutUpdate(); 181 void RefreshCastButtonVisibilityWithoutUpdate();
197 182
183 // Methods called by MediaControlsMediaEventListener.
184 void OnVolumeChange();
185 void OnFocusIn();
186 void OnTimeUpdate();
187 void OnDurationChange();
188 void OnPlay();
189 void OnPlaying();
190 void OnPause();
191 void OnTextTracksAddedOrRemoved();
192 void OnTextTracksChanged();
193 void OnError();
194 void OnLoadedMetadata();
195 void OnEnteredFullscreen();
196 void OnExitedFullscreen();
197 void OnPanelKeypress();
198
198 // Media control elements. 199 // Media control elements.
199 Member<MediaControlOverlayEnclosureElement> overlay_enclosure_; 200 Member<MediaControlOverlayEnclosureElement> overlay_enclosure_;
200 Member<MediaControlOverlayPlayButtonElement> overlay_play_button_; 201 Member<MediaControlOverlayPlayButtonElement> overlay_play_button_;
201 Member<MediaControlCastButtonElement> overlay_cast_button_; 202 Member<MediaControlCastButtonElement> overlay_cast_button_;
202 Member<MediaControlPanelEnclosureElement> enclosure_; 203 Member<MediaControlPanelEnclosureElement> enclosure_;
203 Member<MediaControlPanelElement> panel_; 204 Member<MediaControlPanelElement> panel_;
204 Member<MediaControlPlayButtonElement> play_button_; 205 Member<MediaControlPlayButtonElement> play_button_;
205 Member<MediaControlTimelineElement> timeline_; 206 Member<MediaControlTimelineElement> timeline_;
206 Member<MediaControlCurrentTimeDisplayElement> current_time_display_; 207 Member<MediaControlCurrentTimeDisplayElement> current_time_display_;
207 Member<MediaControlTimeRemainingDisplayElement> duration_display_; 208 Member<MediaControlTimeRemainingDisplayElement> duration_display_;
(...skipping 26 matching lines...) Expand all
234 IntSize size_; 235 IntSize size_;
235 236
236 bool keep_showing_until_timer_fires_ : 1; 237 bool keep_showing_until_timer_fires_ : 1;
237 }; 238 };
238 239
239 DEFINE_ELEMENT_TYPE_CASTS(MediaControlsImpl, IsMediaControls()); 240 DEFINE_ELEMENT_TYPE_CASTS(MediaControlsImpl, IsMediaControls());
240 241
241 } // namespace blink 242 } // namespace blink
242 243
243 #endif 244 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698