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

Side by Side Diff: third_party/WebKit/Source/modules/media_controls/elements/MediaControlOverlayEnclosureElement.cpp

Issue 2811703002: Move a few media controls elements into modules/media_controls/elements/. (Closed)
Patch Set: 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "modules/media_controls/elements/MediaControlOverlayEnclosureElement.h"
6
7 #include "core/events/Event.h"
8 #include "modules/media_controls/MediaControlsImpl.h"
9
10 namespace blink {
11
12 MediaControlOverlayEnclosureElement::MediaControlOverlayEnclosureElement(
13 MediaControlsImpl& media_controls)
14 : MediaControlDivElement(media_controls, kMediaControlsPanel) {
15 SetShadowPseudoId(AtomicString("-webkit-media-controls-overlay-enclosure"));
16 }
17
18 EventDispatchHandlingState*
19 MediaControlOverlayEnclosureElement::PreDispatchEventHandler(Event* event) {
20 // When the media element is clicked or touched we want to make the overlay
21 // cast button visible (if the other requirements are right) even if
22 // JavaScript is doing its own handling of the event. Doing it in
23 // preDispatchEventHandler prevents any interference from JavaScript.
24 // Note that we can't simply test for click, since JS handling of touch events
25 // can prevent their translation to click events.
26 if (event && (event->type() == EventTypeNames::click ||
27 event->type() == EventTypeNames::touchstart)) {
28 static_cast<MediaControlsImpl&>(GetMediaControls())
29 .ShowOverlayCastButtonIfNeeded();
30 }
31 return MediaControlDivElement::PreDispatchEventHandler(event);
32 }
33
34 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698