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

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

Issue 2802133002: Move MediaControlsWindowEventListener to modules/media_controls/. (Closed)
Patch Set: rebase after blink rename 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 void OnDisableRemotePlaybackAttributeChanged() override { 80 void OnDisableRemotePlaybackAttributeChanged() override {
81 RefreshCastButtonVisibility(); 81 RefreshCastButtonVisibility();
82 } 82 }
83 // Notify us that the media element's network state has changed. 83 // Notify us that the media element's network state has changed.
84 void NetworkStateChanged() override; 84 void NetworkStateChanged() override;
85 LayoutObject* PanelLayoutObject() override; 85 LayoutObject* PanelLayoutObject() override;
86 LayoutObject* ContainerLayoutObject() override; 86 LayoutObject* ContainerLayoutObject() override;
87 // Return the internal elements, which is used by registering clicking 87 // Return the internal elements, which is used by registering clicking
88 // EventHandlers from MediaControlsWindowEventListener. 88 // EventHandlers from MediaControlsWindowEventListener.
89 MediaControlPanelElement* PanelElement() override { return panel_; } 89 MediaControlPanelElement* PanelElement() override { return panel_; }
90 MediaControlTimelineElement* TimelineElement() override { return timeline_; }
91 MediaControlCastButtonElement* CastButtonElement() override {
92 return cast_button_;
93 }
94 MediaControlVolumeSliderElement* VolumeSliderElement() override {
95 return volume_slider_;
96 }
97 void BeginScrubbing() override; 90 void BeginScrubbing() override;
98 void EndScrubbing() override; 91 void EndScrubbing() override;
99 void UpdateCurrentTimeDisplay() override; 92 void UpdateCurrentTimeDisplay() override;
100 void ToggleTextTrackList() override; 93 void ToggleTextTrackList() override;
101 void ShowTextTrackAtIndex(unsigned index_to_enable) override; 94 void ShowTextTrackAtIndex(unsigned) override;
102 void DisableShowingTextTracks() override; 95 void DisableShowingTextTracks() override;
103 // Called by the fullscreen buttons to toggle fulllscreen on/off. 96 // Called by the fullscreen buttons to toggle fulllscreen on/off.
104 void EnterFullscreen() override; 97 void EnterFullscreen() override;
105 void ExitFullscreen() override; 98 void ExitFullscreen() override;
106 void ShowOverlayCastButtonIfNeeded() override; 99 void ShowOverlayCastButtonIfNeeded() override;
107 void ToggleOverflowMenu() override; 100 void ToggleOverflowMenu() override;
108 bool OverflowMenuVisible() override; 101 bool OverflowMenuVisible() override;
109 // 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
110 // the `MediaControlsEnabled` setting has changed. 103 // the `MediaControlsEnabled` setting has changed.
111 void OnMediaControlsEnabledChange() override { 104 void OnMediaControlsEnabledChange() override {
(...skipping 13 matching lines...) Expand all
125 void OnError() override; 118 void OnError() override;
126 void OnLoadedMetadata() override; 119 void OnLoadedMetadata() override;
127 void OnEnteredFullscreen() override; 120 void OnEnteredFullscreen() override;
128 void OnExitedFullscreen() override; 121 void OnExitedFullscreen() override;
129 void OnPanelKeypress() override; 122 void OnPanelKeypress() override;
130 Document& OwnerDocument() { return GetDocument(); } 123 Document& OwnerDocument() { return GetDocument(); }
131 124
132 DECLARE_VIRTUAL_TRACE(); 125 DECLARE_VIRTUAL_TRACE();
133 126
134 private: 127 private:
128 // MediaControlsMediaEventListener is a component that is listening to events
129 // and calling the appropriate callback on MediaControlsImpl. The object is
130 // split from MedaiControlsImpl to reduce boilerplate and ease reading. In
131 // order to not expose accessors only for this component, a friendship is
132 // declared.
135 friend class MediaControlsMediaEventListener; 133 friend class MediaControlsMediaEventListener;
134 // Same as above but handles the menus hiding when the window is interacted
135 // with, allowing MediaControlsImpl to not have the boilerplate.
136 friend class MediaControlsWindowEventListener;
137
138 // For tests.
136 friend class MediaControlsOrientationLockDelegateTest; 139 friend class MediaControlsOrientationLockDelegateTest;
137 friend class MediaControlsImplTest; 140 friend class MediaControlsImplTest;
138 141
139 // Need to be members of MediaControls for private member access. 142 // Need to be members of MediaControls for private member access.
140 class BatchedControlUpdate; 143 class BatchedControlUpdate;
141 class MediaControlsResizeObserverCallback; 144 class MediaControlsResizeObserverCallback;
142 145
143 static MediaControlsImpl* Create(HTMLMediaElement&, ShadowRoot&); 146 static MediaControlsImpl* Create(HTMLMediaElement&, ShadowRoot&);
144 147
145 void Invalidate(Element*); 148 void Invalidate(Element*);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 IntSize size_; 234 IntSize size_;
232 235
233 bool keep_showing_until_timer_fires_ : 1; 236 bool keep_showing_until_timer_fires_ : 1;
234 }; 237 };
235 238
236 DEFINE_ELEMENT_TYPE_CASTS(MediaControlsImpl, IsMediaControls()); 239 DEFINE_ELEMENT_TYPE_CASTS(MediaControlsImpl, IsMediaControls());
237 240
238 } // namespace blink 241 } // namespace blink
239 242
240 #endif 243 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698