| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 class MediaControlMuteButtonElement; | 45 class MediaControlMuteButtonElement; |
| 46 class MediaControlOverflowMenuButtonElement; | 46 class MediaControlOverflowMenuButtonElement; |
| 47 class MediaControlOverflowMenuListElement; | 47 class MediaControlOverflowMenuListElement; |
| 48 class MediaControlOverlayEnclosureElement; | 48 class MediaControlOverlayEnclosureElement; |
| 49 class MediaControlOverlayPlayButtonElement; | 49 class MediaControlOverlayPlayButtonElement; |
| 50 class MediaControlPanelElement; | 50 class MediaControlPanelElement; |
| 51 class MediaControlPanelEnclosureElement; | 51 class MediaControlPanelEnclosureElement; |
| 52 class MediaControlPlayButtonElement; | 52 class MediaControlPlayButtonElement; |
| 53 class MediaControlRemainingTimeDisplayElement; | 53 class MediaControlRemainingTimeDisplayElement; |
| 54 class MediaControlTextTrackListElement; | 54 class MediaControlTextTrackListElement; |
| 55 class MediaControlTimelineElement; |
| 55 class MediaControlToggleClosedCaptionsButtonElement; | 56 class MediaControlToggleClosedCaptionsButtonElement; |
| 56 class ShadowRoot; | 57 class ShadowRoot; |
| 57 | 58 |
| 58 // Default implementation of the core/ MediaControls interface used by | 59 // Default implementation of the core/ MediaControls interface used by |
| 59 // HTMLMediaElement. | 60 // HTMLMediaElement. |
| 60 class MODULES_EXPORT MediaControlsImpl final : public HTMLDivElement, | 61 class MODULES_EXPORT MediaControlsImpl final : public HTMLDivElement, |
| 61 public MediaControls { | 62 public MediaControls { |
| 62 USING_GARBAGE_COLLECTED_MIXIN(MediaControlsImpl); | 63 USING_GARBAGE_COLLECTED_MIXIN(MediaControlsImpl); |
| 63 WTF_MAKE_NONCOPYABLE(MediaControlsImpl); | 64 WTF_MAKE_NONCOPYABLE(MediaControlsImpl); |
| 64 | 65 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 95 void OnDisableRemotePlaybackAttributeChanged() override { | 96 void OnDisableRemotePlaybackAttributeChanged() override { |
| 96 RefreshCastButtonVisibility(); | 97 RefreshCastButtonVisibility(); |
| 97 } | 98 } |
| 98 // Notify us that the media element's network state has changed. | 99 // Notify us that the media element's network state has changed. |
| 99 void NetworkStateChanged() override; | 100 void NetworkStateChanged() override; |
| 100 LayoutObject* PanelLayoutObject() override; | 101 LayoutObject* PanelLayoutObject() override; |
| 101 LayoutObject* ContainerLayoutObject() override; | 102 LayoutObject* ContainerLayoutObject() override; |
| 102 // Return the internal elements, which is used by registering clicking | 103 // Return the internal elements, which is used by registering clicking |
| 103 // EventHandlers from MediaControlsWindowEventListener. | 104 // EventHandlers from MediaControlsWindowEventListener. |
| 104 HTMLDivElement* PanelElement() override; | 105 HTMLDivElement* PanelElement() override; |
| 105 void BeginScrubbing() override; | |
| 106 void EndScrubbing() override; | |
| 107 void UpdateCurrentTimeDisplay() override; | |
| 108 bool OverflowMenuVisible() override; | |
| 109 // TODO(mlamouri): this method is needed in order to notify the controls that | 106 // TODO(mlamouri): this method is needed in order to notify the controls that |
| 110 // the `MediaControlsEnabled` setting has changed. | 107 // the `MediaControlsEnabled` setting has changed. |
| 111 void OnMediaControlsEnabledChange() override { | 108 void OnMediaControlsEnabledChange() override { |
| 112 // There is no update because only the overlay is expected to change. | 109 // There is no update because only the overlay is expected to change. |
| 113 RefreshCastButtonVisibilityWithoutUpdate(); | 110 RefreshCastButtonVisibilityWithoutUpdate(); |
| 114 } | 111 } |
| 115 Document& OwnerDocument() { return GetDocument(); } | 112 Document& OwnerDocument() { return GetDocument(); } |
| 116 | 113 |
| 117 // Called by the fullscreen buttons to toggle fulllscreen on/off. | 114 // Called by the fullscreen buttons to toggle fulllscreen on/off. |
| 118 void EnterFullscreen(); | 115 void EnterFullscreen(); |
| 119 void ExitFullscreen(); | 116 void ExitFullscreen(); |
| 120 | 117 |
| 121 // Text track related methods exposed to components handling closed captions. | 118 // Text track related methods exposed to components handling closed captions. |
| 122 void ToggleTextTrackList(); | 119 void ToggleTextTrackList(); |
| 123 void ShowTextTrackAtIndex(unsigned); | 120 void ShowTextTrackAtIndex(unsigned); |
| 124 void DisableShowingTextTracks(); | 121 void DisableShowingTextTracks(); |
| 125 | 122 |
| 126 // Toggle the overflow menu visibility. | 123 // Methods related to the overflow menu. |
| 127 void ToggleOverflowMenu(); | 124 void ToggleOverflowMenu(); |
| 125 bool OverflowMenuVisible(); |
| 128 | 126 |
| 129 void ShowOverlayCastButtonIfNeeded(); | 127 void ShowOverlayCastButtonIfNeeded(); |
| 130 | 128 |
| 129 // Methods call by the scrubber. |
| 130 void BeginScrubbing(); |
| 131 void EndScrubbing(); |
| 132 void UpdateCurrentTimeDisplay(); |
| 133 |
| 131 DECLARE_VIRTUAL_TRACE(); | 134 DECLARE_VIRTUAL_TRACE(); |
| 132 | 135 |
| 133 private: | 136 private: |
| 134 // MediaControlsMediaEventListener is a component that is listening to events | 137 // MediaControlsMediaEventListener is a component that is listening to events |
| 135 // and calling the appropriate callback on MediaControlsImpl. The object is | 138 // and calling the appropriate callback on MediaControlsImpl. The object is |
| 136 // split from MedaiControlsImpl to reduce boilerplate and ease reading. In | 139 // split from MedaiControlsImpl to reduce boilerplate and ease reading. In |
| 137 // order to not expose accessors only for this component, a friendship is | 140 // order to not expose accessors only for this component, a friendship is |
| 138 // declared. | 141 // declared. |
| 139 friend class MediaControlsMediaEventListener; | 142 friend class MediaControlsMediaEventListener; |
| 140 // Same as above but handles the menus hiding when the window is interacted | 143 // Same as above but handles the menus hiding when the window is interacted |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 IntSize size_; | 259 IntSize size_; |
| 257 | 260 |
| 258 bool keep_showing_until_timer_fires_ : 1; | 261 bool keep_showing_until_timer_fires_ : 1; |
| 259 }; | 262 }; |
| 260 | 263 |
| 261 DEFINE_ELEMENT_TYPE_CASTS(MediaControlsImpl, IsMediaControls()); | 264 DEFINE_ELEMENT_TYPE_CASTS(MediaControlsImpl, IsMediaControls()); |
| 262 | 265 |
| 263 } // namespace blink | 266 } // namespace blink |
| 264 | 267 |
| 265 #endif | 268 #endif |
| OLD | NEW |