| 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 21 matching lines...) Expand all Loading... |
| 32 #include "core/html/shadow/MediaControlElements.h" | 32 #include "core/html/shadow/MediaControlElements.h" |
| 33 #include "modules/ModulesExport.h" | 33 #include "modules/ModulesExport.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 class Event; | 37 class Event; |
| 38 class MediaControlsMediaEventListener; | 38 class MediaControlsMediaEventListener; |
| 39 class MediaControlsOrientationLockDelegate; | 39 class MediaControlsOrientationLockDelegate; |
| 40 class MediaControlsWindowEventListener; | 40 class MediaControlsWindowEventListener; |
| 41 class MediaControlCurrentTimeDisplayElement; | 41 class MediaControlCurrentTimeDisplayElement; |
| 42 class MediaControlFullscreenButtonElement; |
| 42 class MediaControlMuteButtonElement; | 43 class MediaControlMuteButtonElement; |
| 44 class MediaControlOverflowMenuButtonElement; |
| 43 class MediaControlOverflowMenuListElement; | 45 class MediaControlOverflowMenuListElement; |
| 44 class MediaControlOverlayEnclosureElement; | 46 class MediaControlOverlayEnclosureElement; |
| 47 class MediaControlOverlayPlayButtonElement; |
| 45 class MediaControlPanelElement; | 48 class MediaControlPanelElement; |
| 46 class MediaControlPanelEnclosureElement; | 49 class MediaControlPanelEnclosureElement; |
| 50 class MediaControlPlayButtonElement; |
| 47 class MediaControlRemainingTimeDisplayElement; | 51 class MediaControlRemainingTimeDisplayElement; |
| 48 class MediaControlTextTrackListElement; | 52 class MediaControlTextTrackListElement; |
| 53 class MediaControlToggleClosedCaptionsButtonElement; |
| 49 class ShadowRoot; | 54 class ShadowRoot; |
| 50 | 55 |
| 51 // Default implementation of the core/ MediaControls interface used by | 56 // Default implementation of the core/ MediaControls interface used by |
| 52 // HTMLMediaElement. | 57 // HTMLMediaElement. |
| 53 class MODULES_EXPORT MediaControlsImpl final : public HTMLDivElement, | 58 class MODULES_EXPORT MediaControlsImpl final : public HTMLDivElement, |
| 54 public MediaControls { | 59 public MediaControls { |
| 55 USING_GARBAGE_COLLECTED_MIXIN(MediaControlsImpl); | 60 USING_GARBAGE_COLLECTED_MIXIN(MediaControlsImpl); |
| 56 WTF_MAKE_NONCOPYABLE(MediaControlsImpl); | 61 WTF_MAKE_NONCOPYABLE(MediaControlsImpl); |
| 57 | 62 |
| 58 public: | 63 public: |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // Notify us that the media element's network state has changed. | 96 // Notify us that the media element's network state has changed. |
| 92 void NetworkStateChanged() override; | 97 void NetworkStateChanged() override; |
| 93 LayoutObject* PanelLayoutObject() override; | 98 LayoutObject* PanelLayoutObject() override; |
| 94 LayoutObject* ContainerLayoutObject() override; | 99 LayoutObject* ContainerLayoutObject() override; |
| 95 // Return the internal elements, which is used by registering clicking | 100 // Return the internal elements, which is used by registering clicking |
| 96 // EventHandlers from MediaControlsWindowEventListener. | 101 // EventHandlers from MediaControlsWindowEventListener. |
| 97 HTMLDivElement* PanelElement() override; | 102 HTMLDivElement* PanelElement() override; |
| 98 void BeginScrubbing() override; | 103 void BeginScrubbing() override; |
| 99 void EndScrubbing() override; | 104 void EndScrubbing() override; |
| 100 void UpdateCurrentTimeDisplay() override; | 105 void UpdateCurrentTimeDisplay() override; |
| 101 void ToggleTextTrackList() override; | |
| 102 void ShowTextTrackAtIndex(unsigned) override; | |
| 103 void DisableShowingTextTracks() override; | |
| 104 // Called by the fullscreen buttons to toggle fulllscreen on/off. | |
| 105 void EnterFullscreen() override; | |
| 106 void ExitFullscreen() override; | |
| 107 void ToggleOverflowMenu() override; | |
| 108 bool OverflowMenuVisible() override; | 106 bool OverflowMenuVisible() override; |
| 109 // TODO(mlamouri): this method is needed in order to notify the controls that | 107 // TODO(mlamouri): this method is needed in order to notify the controls that |
| 110 // the `MediaControlsEnabled` setting has changed. | 108 // the `MediaControlsEnabled` setting has changed. |
| 111 void OnMediaControlsEnabledChange() override { | 109 void OnMediaControlsEnabledChange() override { |
| 112 // There is no update because only the overlay is expected to change. | 110 // There is no update because only the overlay is expected to change. |
| 113 RefreshCastButtonVisibilityWithoutUpdate(); | 111 RefreshCastButtonVisibilityWithoutUpdate(); |
| 114 } | 112 } |
| 115 Document& OwnerDocument() { return GetDocument(); } | 113 Document& OwnerDocument() { return GetDocument(); } |
| 116 | 114 |
| 115 // Called by the fullscreen buttons to toggle fulllscreen on/off. |
| 116 void EnterFullscreen(); |
| 117 void ExitFullscreen(); |
| 118 |
| 119 // Text track related methods exposed to components handling closed captions. |
| 120 void ToggleTextTrackList(); |
| 121 void ShowTextTrackAtIndex(unsigned); |
| 122 void DisableShowingTextTracks(); |
| 123 |
| 124 // Toggle the overflow menu visibility. |
| 125 void ToggleOverflowMenu(); |
| 126 |
| 117 void ShowOverlayCastButtonIfNeeded(); | 127 void ShowOverlayCastButtonIfNeeded(); |
| 118 | 128 |
| 119 DECLARE_VIRTUAL_TRACE(); | 129 DECLARE_VIRTUAL_TRACE(); |
| 120 | 130 |
| 121 private: | 131 private: |
| 122 // MediaControlsMediaEventListener is a component that is listening to events | 132 // MediaControlsMediaEventListener is a component that is listening to events |
| 123 // and calling the appropriate callback on MediaControlsImpl. The object is | 133 // and calling the appropriate callback on MediaControlsImpl. The object is |
| 124 // split from MedaiControlsImpl to reduce boilerplate and ease reading. In | 134 // split from MedaiControlsImpl to reduce boilerplate and ease reading. In |
| 125 // order to not expose accessors only for this component, a friendship is | 135 // order to not expose accessors only for this component, a friendship is |
| 126 // declared. | 136 // declared. |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 IntSize size_; | 254 IntSize size_; |
| 245 | 255 |
| 246 bool keep_showing_until_timer_fires_ : 1; | 256 bool keep_showing_until_timer_fires_ : 1; |
| 247 }; | 257 }; |
| 248 | 258 |
| 249 DEFINE_ELEMENT_TYPE_CASTS(MediaControlsImpl, IsMediaControls()); | 259 DEFINE_ELEMENT_TYPE_CASTS(MediaControlsImpl, IsMediaControls()); |
| 250 | 260 |
| 251 } // namespace blink | 261 } // namespace blink |
| 252 | 262 |
| 253 #endif | 263 #endif |
| OLD | NEW |