| 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 12 matching lines...) Expand all Loading... |
| 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #ifndef MediaControlsImpl_h | 27 #ifndef MediaControlsImpl_h |
| 28 #define MediaControlsImpl_h | 28 #define MediaControlsImpl_h |
| 29 | 29 |
| 30 #include "core/html/HTMLDivElement.h" | 30 #include "core/html/HTMLDivElement.h" |
| 31 #include "core/html/media/MediaControls.h" | 31 #include "core/html/media/MediaControls.h" |
| 32 #include "modules/ModulesExport.h" | 32 #include "modules/ModulesExport.h" |
| 33 #include "public/platform/media_in_product_help.mojom-blink.h" |
| 33 | 34 |
| 34 namespace blink { | 35 namespace blink { |
| 35 | 36 |
| 36 class Event; | 37 class Event; |
| 37 class MediaControlsMediaEventListener; | 38 class MediaControlsMediaEventListener; |
| 38 class MediaControlsOrientationLockDelegate; | 39 class MediaControlsOrientationLockDelegate; |
| 39 class MediaControlsRotateToFullscreenDelegate; | 40 class MediaControlsRotateToFullscreenDelegate; |
| 40 class MediaControlsWindowEventListener; | 41 class MediaControlsWindowEventListener; |
| 41 class MediaControlCastButtonElement; | 42 class MediaControlCastButtonElement; |
| 42 class MediaControlCurrentTimeDisplayElement; | 43 class MediaControlCurrentTimeDisplayElement; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 void ToggleOverflowMenu(); | 114 void ToggleOverflowMenu(); |
| 114 bool OverflowMenuVisible(); | 115 bool OverflowMenuVisible(); |
| 115 | 116 |
| 116 void ShowOverlayCastButtonIfNeeded(); | 117 void ShowOverlayCastButtonIfNeeded(); |
| 117 | 118 |
| 118 // Methods call by the scrubber. | 119 // Methods call by the scrubber. |
| 119 void BeginScrubbing(); | 120 void BeginScrubbing(); |
| 120 void EndScrubbing(); | 121 void EndScrubbing(); |
| 121 void UpdateCurrentTimeDisplay(); | 122 void UpdateCurrentTimeDisplay(); |
| 122 | 123 |
| 124 void MaybeDispatchDownloadIPHTrigger(); |
| 125 |
| 123 DECLARE_VIRTUAL_TRACE(); | 126 DECLARE_VIRTUAL_TRACE(); |
| 124 | 127 |
| 125 private: | 128 private: |
| 126 // MediaControlsMediaEventListener is a component that is listening to events | 129 // MediaControlsMediaEventListener is a component that is listening to events |
| 127 // and calling the appropriate callback on MediaControlsImpl. The object is | 130 // and calling the appropriate callback on MediaControlsImpl. The object is |
| 128 // split from MedaiControlsImpl to reduce boilerplate and ease reading. In | 131 // split from MedaiControlsImpl to reduce boilerplate and ease reading. In |
| 129 // order to not expose accessors only for this component, a friendship is | 132 // order to not expose accessors only for this component, a friendship is |
| 130 // declared. | 133 // declared. |
| 131 friend class MediaControlsMediaEventListener; | 134 friend class MediaControlsMediaEventListener; |
| 132 // Same as above but handles the menus hiding when the window is interacted | 135 // Same as above but handles the menus hiding when the window is interacted |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 void OnPause(); | 208 void OnPause(); |
| 206 void OnTextTracksAddedOrRemoved(); | 209 void OnTextTracksAddedOrRemoved(); |
| 207 void OnTextTracksChanged(); | 210 void OnTextTracksChanged(); |
| 208 void OnError(); | 211 void OnError(); |
| 209 void OnLoadedMetadata(); | 212 void OnLoadedMetadata(); |
| 210 void OnEnteredFullscreen(); | 213 void OnEnteredFullscreen(); |
| 211 void OnExitedFullscreen(); | 214 void OnExitedFullscreen(); |
| 212 void OnPanelKeypress(); | 215 void OnPanelKeypress(); |
| 213 void OnMediaKeyboardEvent(Event* event) { DefaultEventHandler(event); } | 216 void OnMediaKeyboardEvent(Event* event) { DefaultEventHandler(event); } |
| 214 | 217 |
| 218 void UpdateDownloadInProductHelpState(); |
| 219 void DismissDownloadInProductHelp(); |
| 220 |
| 215 // Media control elements. | 221 // Media control elements. |
| 216 Member<MediaControlOverlayEnclosureElement> overlay_enclosure_; | 222 Member<MediaControlOverlayEnclosureElement> overlay_enclosure_; |
| 217 Member<MediaControlOverlayPlayButtonElement> overlay_play_button_; | 223 Member<MediaControlOverlayPlayButtonElement> overlay_play_button_; |
| 218 Member<MediaControlCastButtonElement> overlay_cast_button_; | 224 Member<MediaControlCastButtonElement> overlay_cast_button_; |
| 219 Member<MediaControlPanelEnclosureElement> enclosure_; | 225 Member<MediaControlPanelEnclosureElement> enclosure_; |
| 220 Member<MediaControlPanelElement> panel_; | 226 Member<MediaControlPanelElement> panel_; |
| 221 Member<MediaControlPlayButtonElement> play_button_; | 227 Member<MediaControlPlayButtonElement> play_button_; |
| 222 Member<MediaControlTimelineElement> timeline_; | 228 Member<MediaControlTimelineElement> timeline_; |
| 223 Member<MediaControlCurrentTimeDisplayElement> current_time_display_; | 229 Member<MediaControlCurrentTimeDisplayElement> current_time_display_; |
| 224 Member<MediaControlRemainingTimeDisplayElement> duration_display_; | 230 Member<MediaControlRemainingTimeDisplayElement> duration_display_; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 250 Member<ResizeObserver> resize_observer_; | 256 Member<ResizeObserver> resize_observer_; |
| 251 | 257 |
| 252 // Watches the media element for attribute changes and updates media controls | 258 // Watches the media element for attribute changes and updates media controls |
| 253 // as necessary. | 259 // as necessary. |
| 254 Member<MediaElementMutationCallback> element_mutation_callback_; | 260 Member<MediaElementMutationCallback> element_mutation_callback_; |
| 255 | 261 |
| 256 TaskRunnerTimer<MediaControlsImpl> element_size_changed_timer_; | 262 TaskRunnerTimer<MediaControlsImpl> element_size_changed_timer_; |
| 257 IntSize size_; | 263 IntSize size_; |
| 258 | 264 |
| 259 bool keep_showing_until_timer_fires_ : 1; | 265 bool keep_showing_until_timer_fires_ : 1; |
| 266 |
| 267 std::unique_ptr<mojom::blink::MediaInProductHelpPtr> media_in_product_help_; |
| 268 bool media_download_in_product_trigger_observed_ = false; |
| 260 }; | 269 }; |
| 261 | 270 |
| 262 DEFINE_ELEMENT_TYPE_CASTS(MediaControlsImpl, IsMediaControls()); | 271 DEFINE_ELEMENT_TYPE_CASTS(MediaControlsImpl, IsMediaControls()); |
| 263 | 272 |
| 264 } // namespace blink | 273 } // namespace blink |
| 265 | 274 |
| 266 #endif | 275 #endif |
| OLD | NEW |