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

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

Issue 2943983003: chrome/blink: Add functionality for in-product help for media elements. (Closed)
Patch Set: .. Created 3 years, 3 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 class MediaControlOverlayEnclosureElement; 49 class MediaControlOverlayEnclosureElement;
50 class MediaControlOverlayPlayButtonElement; 50 class MediaControlOverlayPlayButtonElement;
51 class MediaControlPanelElement; 51 class MediaControlPanelElement;
52 class MediaControlPanelEnclosureElement; 52 class MediaControlPanelEnclosureElement;
53 class MediaControlPlayButtonElement; 53 class MediaControlPlayButtonElement;
54 class MediaControlRemainingTimeDisplayElement; 54 class MediaControlRemainingTimeDisplayElement;
55 class MediaControlTextTrackListElement; 55 class MediaControlTextTrackListElement;
56 class MediaControlTimelineElement; 56 class MediaControlTimelineElement;
57 class MediaControlToggleClosedCaptionsButtonElement; 57 class MediaControlToggleClosedCaptionsButtonElement;
58 class MediaControlVolumeSliderElement; 58 class MediaControlVolumeSliderElement;
59 class MediaDownloadInProductHelpManager;
59 class ShadowRoot; 60 class ShadowRoot;
60 61
61 // Default implementation of the core/ MediaControls interface used by 62 // Default implementation of the core/ MediaControls interface used by
62 // HTMLMediaElement. 63 // HTMLMediaElement.
63 class MODULES_EXPORT MediaControlsImpl final : public HTMLDivElement, 64 class MODULES_EXPORT MediaControlsImpl final : public HTMLDivElement,
64 public MediaControls { 65 public MediaControls {
65 USING_GARBAGE_COLLECTED_MIXIN(MediaControlsImpl); 66 USING_GARBAGE_COLLECTED_MIXIN(MediaControlsImpl);
66 WTF_MAKE_NONCOPYABLE(MediaControlsImpl); 67 WTF_MAKE_NONCOPYABLE(MediaControlsImpl);
67 68
68 public: 69 public:
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 void ToggleOverflowMenu(); 110 void ToggleOverflowMenu();
110 bool OverflowMenuVisible(); 111 bool OverflowMenuVisible();
111 112
112 void ShowOverlayCastButtonIfNeeded(); 113 void ShowOverlayCastButtonIfNeeded();
113 114
114 // Methods call by the scrubber. 115 // Methods call by the scrubber.
115 void BeginScrubbing(); 116 void BeginScrubbing();
116 void EndScrubbing(); 117 void EndScrubbing();
117 void UpdateCurrentTimeDisplay(); 118 void UpdateCurrentTimeDisplay();
118 119
120 // Methods used for Download In-product help.
121 const MediaControlDownloadButtonElement& DownloadButton() const;
122 void DidDismissDownloadInProductHelp();
123 MediaDownloadInProductHelpManager* DownloadInProductHelp();
124
119 DECLARE_VIRTUAL_TRACE(); 125 DECLARE_VIRTUAL_TRACE();
120 126
121 private: 127 private:
122 // MediaControlsMediaEventListener is a component that is listening to events 128 // MediaControlsMediaEventListener is a component that is listening to events
123 // and calling the appropriate callback on MediaControlsImpl. The object is 129 // and calling the appropriate callback on MediaControlsImpl. The object is
124 // split from MedaiControlsImpl to reduce boilerplate and ease reading. In 130 // split from MedaiControlsImpl to reduce boilerplate and ease reading. In
125 // order to not expose accessors only for this component, a friendship is 131 // order to not expose accessors only for this component, a friendship is
126 // declared. 132 // declared.
127 friend class MediaControlsMediaEventListener; 133 friend class MediaControlsMediaEventListener;
128 // Same as above but handles the menus hiding when the window is interacted 134 // Same as above but handles the menus hiding when the window is interacted
129 // with, allowing MediaControlsImpl to not have the boilerplate. 135 // with, allowing MediaControlsImpl to not have the boilerplate.
130 friend class MediaControlsWindowEventListener; 136 friend class MediaControlsWindowEventListener;
131 137
132 // For tests. 138 // For tests.
133 friend class MediaControlsOrientationLockDelegateTest; 139 friend class MediaControlsOrientationLockDelegateTest;
134 friend class MediaControlsOrientationLockAndRotateToFullscreenDelegateTest; 140 friend class MediaControlsOrientationLockAndRotateToFullscreenDelegateTest;
135 friend class MediaControlsRotateToFullscreenDelegateTest; 141 friend class MediaControlsRotateToFullscreenDelegateTest;
136 friend class MediaControlsImplTest; 142 friend class MediaControlsImplTest;
143 friend class MediaControlsImplInProductHelpTest;
137 144
138 // Need to be members of MediaControls for private member access. 145 // Need to be members of MediaControls for private member access.
139 class BatchedControlUpdate; 146 class BatchedControlUpdate;
140 class MediaControlsResizeObserverDelegate; 147 class MediaControlsResizeObserverDelegate;
141 class MediaElementMutationCallback; 148 class MediaElementMutationCallback;
142 149
143 void Invalidate(Element*); 150 void Invalidate(Element*);
144 151
145 // Notify us that our controls enclosure has changed size. 152 // Notify us that our controls enclosure has changed size.
146 void NotifyElementSizeChanged(DOMRectReadOnly* new_size); 153 void NotifyElementSizeChanged(DOMRectReadOnly* new_size);
(...skipping 11 matching lines...) Expand all
158 enum HideBehaviorFlags { 165 enum HideBehaviorFlags {
159 kIgnoreNone = 0, 166 kIgnoreNone = 0,
160 kIgnoreVideoHover = 1 << 0, 167 kIgnoreVideoHover = 1 << 0,
161 kIgnoreFocus = 1 << 1, 168 kIgnoreFocus = 1 << 1,
162 kIgnoreControlsHover = 1 << 2, 169 kIgnoreControlsHover = 1 << 2,
163 kIgnoreWaitForTimer = 1 << 3, 170 kIgnoreWaitForTimer = 1 << 3,
164 }; 171 };
165 172
166 bool ShouldHideMediaControls(unsigned behavior_flags = 0) const; 173 bool ShouldHideMediaControls(unsigned behavior_flags = 0) const;
167 void HideMediaControlsTimerFired(TimerBase*); 174 void HideMediaControlsTimerFired(TimerBase*);
175 void StartHideMediaControlsIfNecessary();
168 void StartHideMediaControlsTimer(); 176 void StartHideMediaControlsTimer();
169 void StopHideMediaControlsTimer(); 177 void StopHideMediaControlsTimer();
170 void ResetHideMediaControlsTimer(); 178 void ResetHideMediaControlsTimer();
171 179
172 void ElementSizeChangedTimerFired(TimerBase*); 180 void ElementSizeChangedTimerFired(TimerBase*);
173 181
174 void HideAllMenus(); 182 void HideAllMenus();
175 183
176 // Hide elements that don't fit, and show those things that we want which 184 // Hide elements that don't fit, and show those things that we want which
177 // do fit. This requires that m_effectiveWidth and m_effectiveHeight are 185 // do fit. This requires that m_effectiveWidth and m_effectiveHeight are
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 Member<ResizeObserver> resize_observer_; 252 Member<ResizeObserver> resize_observer_;
245 253
246 // Watches the media element for attribute changes and updates media controls 254 // Watches the media element for attribute changes and updates media controls
247 // as necessary. 255 // as necessary.
248 Member<MediaElementMutationCallback> element_mutation_callback_; 256 Member<MediaElementMutationCallback> element_mutation_callback_;
249 257
250 TaskRunnerTimer<MediaControlsImpl> element_size_changed_timer_; 258 TaskRunnerTimer<MediaControlsImpl> element_size_changed_timer_;
251 IntSize size_; 259 IntSize size_;
252 260
253 bool keep_showing_until_timer_fires_ : 1; 261 bool keep_showing_until_timer_fires_ : 1;
262
263 Member<MediaDownloadInProductHelpManager> download_iph_manager_;
254 }; 264 };
255 265
256 DEFINE_ELEMENT_TYPE_CASTS(MediaControlsImpl, IsMediaControls()); 266 DEFINE_ELEMENT_TYPE_CASTS(MediaControlsImpl, IsMediaControls());
257 267
258 } // namespace blink 268 } // namespace blink
259 269
260 #endif 270 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698