Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights |
| 3 * reserved. | 3 * 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 24 matching lines...) Expand all Loading... | |
| 35 #include "core/HTMLNames.h" | 35 #include "core/HTMLNames.h" |
| 36 #include "core/css/MediaList.h" | 36 #include "core/css/MediaList.h" |
| 37 #include "core/dom/Attribute.h" | 37 #include "core/dom/Attribute.h" |
| 38 #include "core/dom/DOMException.h" | 38 #include "core/dom/DOMException.h" |
| 39 #include "core/dom/ElementTraversal.h" | 39 #include "core/dom/ElementTraversal.h" |
| 40 #include "core/dom/ElementVisibilityObserver.h" | 40 #include "core/dom/ElementVisibilityObserver.h" |
| 41 #include "core/dom/Fullscreen.h" | 41 #include "core/dom/Fullscreen.h" |
| 42 #include "core/dom/TaskRunnerHelper.h" | 42 #include "core/dom/TaskRunnerHelper.h" |
| 43 #include "core/dom/shadow/ShadowRoot.h" | 43 #include "core/dom/shadow/ShadowRoot.h" |
| 44 #include "core/events/Event.h" | 44 #include "core/events/Event.h" |
| 45 #include "core/events/KeyboardEvent.h" | |
| 45 #include "core/frame/FrameView.h" | 46 #include "core/frame/FrameView.h" |
| 46 #include "core/frame/LocalFrame.h" | 47 #include "core/frame/LocalFrame.h" |
| 47 #include "core/frame/LocalFrameClient.h" | 48 #include "core/frame/LocalFrameClient.h" |
| 48 #include "core/frame/Settings.h" | 49 #include "core/frame/Settings.h" |
| 49 #include "core/frame/UseCounter.h" | 50 #include "core/frame/UseCounter.h" |
| 50 #include "core/frame/csp/ContentSecurityPolicy.h" | 51 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 51 #include "core/html/AutoplayUmaHelper.h" | 52 #include "core/html/AutoplayUmaHelper.h" |
| 52 #include "core/html/HTMLMediaSource.h" | 53 #include "core/html/HTMLMediaSource.h" |
| 53 #include "core/html/HTMLSourceElement.h" | 54 #include "core/html/HTMLSourceElement.h" |
| 54 #include "core/html/HTMLTrackElement.h" | 55 #include "core/html/HTMLTrackElement.h" |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 78 #include "platform/UserGestureIndicator.h" | 79 #include "platform/UserGestureIndicator.h" |
| 79 #include "platform/audio/AudioBus.h" | 80 #include "platform/audio/AudioBus.h" |
| 80 #include "platform/audio/AudioSourceProviderClient.h" | 81 #include "platform/audio/AudioSourceProviderClient.h" |
| 81 #include "platform/graphics/GraphicsLayer.h" | 82 #include "platform/graphics/GraphicsLayer.h" |
| 82 #include "platform/mediastream/MediaStreamDescriptor.h" | 83 #include "platform/mediastream/MediaStreamDescriptor.h" |
| 83 #include "platform/network/NetworkStateNotifier.h" | 84 #include "platform/network/NetworkStateNotifier.h" |
| 84 #include "platform/network/mime/ContentType.h" | 85 #include "platform/network/mime/ContentType.h" |
| 85 #include "platform/network/mime/MIMETypeFromURL.h" | 86 #include "platform/network/mime/MIMETypeFromURL.h" |
| 86 #include "platform/weborigin/SecurityOrigin.h" | 87 #include "platform/weborigin/SecurityOrigin.h" |
| 87 #include "public/platform/Platform.h" | 88 #include "public/platform/Platform.h" |
| 89 #include "public/platform/UserMetricsAction.h" | |
| 88 #include "public/platform/WebAudioSourceProvider.h" | 90 #include "public/platform/WebAudioSourceProvider.h" |
| 89 #include "public/platform/WebContentDecryptionModule.h" | 91 #include "public/platform/WebContentDecryptionModule.h" |
| 90 #include "public/platform/WebInbandTextTrack.h" | 92 #include "public/platform/WebInbandTextTrack.h" |
| 91 #include "public/platform/WebMediaPlayerSource.h" | 93 #include "public/platform/WebMediaPlayerSource.h" |
| 92 #include "public/platform/WebMediaStream.h" | 94 #include "public/platform/WebMediaStream.h" |
| 93 #include "public/platform/modules/remoteplayback/WebRemotePlaybackAvailability.h " | 95 #include "public/platform/modules/remoteplayback/WebRemotePlaybackAvailability.h " |
| 94 #include "public/platform/modules/remoteplayback/WebRemotePlaybackClient.h" | 96 #include "public/platform/modules/remoteplayback/WebRemotePlaybackClient.h" |
| 95 #include "public/platform/modules/remoteplayback/WebRemotePlaybackState.h" | 97 #include "public/platform/modules/remoteplayback/WebRemotePlaybackState.h" |
| 96 #include "wtf/AutoReset.h" | 98 #include "wtf/AutoReset.h" |
| 97 #include "wtf/CurrentTime.h" | 99 #include "wtf/CurrentTime.h" |
| (...skipping 3611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3709 | 3711 |
| 3710 ShadowRoot& shadowRoot = ensureUserAgentShadowRoot(); | 3712 ShadowRoot& shadowRoot = ensureUserAgentShadowRoot(); |
| 3711 m_mediaControls = MediaControls::create(*this, shadowRoot); | 3713 m_mediaControls = MediaControls::create(*this, shadowRoot); |
| 3712 | 3714 |
| 3713 // The media controls should be inserted after the text track container, | 3715 // The media controls should be inserted after the text track container, |
| 3714 // so that they are rendered in front of captions and subtitles. This check | 3716 // so that they are rendered in front of captions and subtitles. This check |
| 3715 // is verifying the contract. | 3717 // is verifying the contract. |
| 3716 assertShadowRootChildren(shadowRoot); | 3718 assertShadowRootChildren(shadowRoot); |
| 3717 } | 3719 } |
| 3718 | 3720 |
| 3721 void HTMLMediaElement::defaultEventHandler(Event* event) { | |
| 3722 if (isFocusedElementInDocument()) { | |
| 3723 if (event->isKeyboardEvent()) { | |
| 3724 m_mediaControls->defaultEventHandler(event); | |
|
mlamouri (slow - plz ping)
2017/03/16 12:17:22
We are working on decoupling HTMLMediaElement and
CJ
2017/03/16 20:08:28
I don't think I know how these classes relate to e
| |
| 3725 } | |
| 3726 } | |
| 3727 HTMLElement::defaultEventHandler(event); | |
| 3728 } | |
| 3729 | |
| 3719 void HTMLMediaElement::updateControlsVisibility() { | 3730 void HTMLMediaElement::updateControlsVisibility() { |
| 3720 if (!isConnected()) { | 3731 if (!isConnected()) { |
| 3721 if (mediaControls()) | 3732 if (mediaControls()) |
| 3722 mediaControls()->hide(); | 3733 mediaControls()->hide(); |
| 3723 return; | 3734 return; |
| 3724 } | 3735 } |
| 3725 | 3736 |
| 3726 ensureMediaControls(); | 3737 ensureMediaControls(); |
| 3727 // TODO(mlamouri): this doesn't sound needed but the following tests, on | 3738 // TODO(mlamouri): this doesn't sound needed but the following tests, on |
| 3728 // Android fails when removed: | 3739 // Android fails when removed: |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4198 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); | 4209 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); |
| 4199 } | 4210 } |
| 4200 | 4211 |
| 4201 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { | 4212 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { |
| 4202 m_mostlyFillingViewport = true; | 4213 m_mostlyFillingViewport = true; |
| 4203 if (m_webMediaPlayer) | 4214 if (m_webMediaPlayer) |
| 4204 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); | 4215 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); |
| 4205 } | 4216 } |
| 4206 | 4217 |
| 4207 } // namespace blink | 4218 } // namespace blink |
| OLD | NEW |