| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 LayoutObject* ContainerLayoutObject() override; | 91 LayoutObject* ContainerLayoutObject() override; |
| 92 // Return the internal elements, which is used by registering clicking | 92 // Return the internal elements, which is used by registering clicking |
| 93 // EventHandlers from MediaControlsWindowEventListener. | 93 // EventHandlers from MediaControlsWindowEventListener. |
| 94 HTMLDivElement* PanelElement() override; | 94 HTMLDivElement* PanelElement() override; |
| 95 // TODO(mlamouri): this method is needed in order to notify the controls that | 95 // TODO(mlamouri): this method is needed in order to notify the controls that |
| 96 // the `MediaControlsEnabled` setting has changed. | 96 // the `MediaControlsEnabled` setting has changed. |
| 97 void OnMediaControlsEnabledChange() override { | 97 void OnMediaControlsEnabledChange() override { |
| 98 // There is no update because only the overlay is expected to change. | 98 // There is no update because only the overlay is expected to change. |
| 99 RefreshCastButtonVisibilityWithoutUpdate(); | 99 RefreshCastButtonVisibilityWithoutUpdate(); |
| 100 } | 100 } |
| 101 bool GetDownloadButtonRect(IntRect&) override; |
| 102 void IPHDisabled() override; |
| 101 Document& OwnerDocument() { return GetDocument(); } | 103 Document& OwnerDocument() { return GetDocument(); } |
| 102 | 104 |
| 103 // Called by the fullscreen buttons to toggle fulllscreen on/off. | 105 // Called by the fullscreen buttons to toggle fulllscreen on/off. |
| 104 void EnterFullscreen(); | 106 void EnterFullscreen(); |
| 105 void ExitFullscreen(); | 107 void ExitFullscreen(); |
| 106 | 108 |
| 107 // Text track related methods exposed to components handling closed captions. | 109 // Text track related methods exposed to components handling closed captions. |
| 108 void ToggleTextTrackList(); | 110 void ToggleTextTrackList(); |
| 109 void ShowTextTrackAtIndex(unsigned); | 111 void ShowTextTrackAtIndex(unsigned); |
| 110 void DisableShowingTextTracks(); | 112 void DisableShowingTextTracks(); |
| 111 | 113 |
| 112 // Methods related to the overflow menu. | 114 // Methods related to the overflow menu. |
| 113 void ToggleOverflowMenu(); | 115 void ToggleOverflowMenu(); |
| 114 bool OverflowMenuVisible(); | 116 bool OverflowMenuVisible(); |
| 115 | 117 |
| 116 void ShowOverlayCastButtonIfNeeded(); | 118 void ShowOverlayCastButtonIfNeeded(); |
| 117 | 119 |
| 118 // Methods call by the scrubber. | 120 // Methods call by the scrubber. |
| 119 void BeginScrubbing(); | 121 void BeginScrubbing(); |
| 120 void EndScrubbing(); | 122 void EndScrubbing(); |
| 121 void UpdateCurrentTimeDisplay(); | 123 void UpdateCurrentTimeDisplay(); |
| 122 | 124 |
| 125 void MaybeDispatchDownloadIPHTrigger(); |
| 126 |
| 123 DECLARE_VIRTUAL_TRACE(); | 127 DECLARE_VIRTUAL_TRACE(); |
| 124 | 128 |
| 125 private: | 129 private: |
| 126 // MediaControlsMediaEventListener is a component that is listening to events | 130 // MediaControlsMediaEventListener is a component that is listening to events |
| 127 // and calling the appropriate callback on MediaControlsImpl. The object is | 131 // and calling the appropriate callback on MediaControlsImpl. The object is |
| 128 // split from MedaiControlsImpl to reduce boilerplate and ease reading. In | 132 // split from MedaiControlsImpl to reduce boilerplate and ease reading. In |
| 129 // order to not expose accessors only for this component, a friendship is | 133 // order to not expose accessors only for this component, a friendship is |
| 130 // declared. | 134 // declared. |
| 131 friend class MediaControlsMediaEventListener; | 135 friend class MediaControlsMediaEventListener; |
| 132 // Same as above but handles the menus hiding when the window is interacted | 136 // Same as above but handles the menus hiding when the window is interacted |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 Member<ResizeObserver> resize_observer_; | 254 Member<ResizeObserver> resize_observer_; |
| 251 | 255 |
| 252 // Watches the media element for attribute changes and updates media controls | 256 // Watches the media element for attribute changes and updates media controls |
| 253 // as necessary. | 257 // as necessary. |
| 254 Member<MediaElementMutationCallback> element_mutation_callback_; | 258 Member<MediaElementMutationCallback> element_mutation_callback_; |
| 255 | 259 |
| 256 TaskRunnerTimer<MediaControlsImpl> element_size_changed_timer_; | 260 TaskRunnerTimer<MediaControlsImpl> element_size_changed_timer_; |
| 257 IntSize size_; | 261 IntSize size_; |
| 258 | 262 |
| 259 bool keep_showing_until_timer_fires_ : 1; | 263 bool keep_showing_until_timer_fires_ : 1; |
| 264 |
| 265 // Set to true when a IPH for the download button on the controls is being |
| 266 // displayed. |
| 267 bool iph_active_ = false; |
| 268 |
| 269 // Set to true after the IPH trigger for an element has been observed. This |
| 270 // ensures that the trigger for an element is observed only once. |
| 271 bool iph_trigger_observed_ = false; |
| 260 }; | 272 }; |
| 261 | 273 |
| 262 DEFINE_ELEMENT_TYPE_CASTS(MediaControlsImpl, IsMediaControls()); | 274 DEFINE_ELEMENT_TYPE_CASTS(MediaControlsImpl, IsMediaControls()); |
| 263 | 275 |
| 264 } // namespace blink | 276 } // namespace blink |
| 265 | 277 |
| 266 #endif | 278 #endif |
| OLD | NEW |