| 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 25 matching lines...) Expand all Loading... |
| 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/DocumentUserGestureToken.h" | 39 #include "core/dom/DocumentUserGestureToken.h" |
| 40 #include "core/dom/ElementTraversal.h" | 40 #include "core/dom/ElementTraversal.h" |
| 41 #include "core/dom/ElementVisibilityObserver.h" | 41 #include "core/dom/ElementVisibilityObserver.h" |
| 42 #include "core/dom/Fullscreen.h" | 42 #include "core/dom/Fullscreen.h" |
| 43 #include "core/dom/TaskRunnerHelper.h" | 43 #include "core/dom/TaskRunnerHelper.h" |
| 44 #include "core/dom/shadow/ShadowRoot.h" | 44 #include "core/dom/shadow/ShadowRoot.h" |
| 45 #include "core/events/Event.h" | 45 #include "core/events/Event.h" |
| 46 #include "core/frame/ContentSettingsClient.h" |
| 46 #include "core/frame/FrameView.h" | 47 #include "core/frame/FrameView.h" |
| 47 #include "core/frame/LocalFrame.h" | 48 #include "core/frame/LocalFrame.h" |
| 48 #include "core/frame/LocalFrameClient.h" | 49 #include "core/frame/LocalFrameClient.h" |
| 49 #include "core/frame/Settings.h" | 50 #include "core/frame/Settings.h" |
| 50 #include "core/frame/UseCounter.h" | 51 #include "core/frame/UseCounter.h" |
| 51 #include "core/frame/csp/ContentSecurityPolicy.h" | 52 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 52 #include "core/html/HTMLSourceElement.h" | 53 #include "core/html/HTMLSourceElement.h" |
| 53 #include "core/html/HTMLTrackElement.h" | 54 #include "core/html/HTMLTrackElement.h" |
| 54 #include "core/html/TimeRanges.h" | 55 #include "core/html/TimeRanges.h" |
| 55 #include "core/html/media/AutoplayUmaHelper.h" | 56 #include "core/html/media/AutoplayUmaHelper.h" |
| (...skipping 3875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3931 return false; | 3932 return false; |
| 3932 } | 3933 } |
| 3933 | 3934 |
| 3934 return true; | 3935 return true; |
| 3935 } | 3936 } |
| 3936 | 3937 |
| 3937 bool HTMLMediaElement::isAutoplayAllowedPerSettings() const { | 3938 bool HTMLMediaElement::isAutoplayAllowedPerSettings() const { |
| 3938 LocalFrame* frame = document().frame(); | 3939 LocalFrame* frame = document().frame(); |
| 3939 if (!frame) | 3940 if (!frame) |
| 3940 return false; | 3941 return false; |
| 3941 LocalFrameClient* localFrameClient = frame->loader().client(); | 3942 return frame->contentSettingsClient()->allowAutoplay(true); |
| 3942 return localFrameClient && localFrameClient->allowAutoplay(true); | |
| 3943 } | 3943 } |
| 3944 | 3944 |
| 3945 void HTMLMediaElement::setNetworkState(NetworkState state) { | 3945 void HTMLMediaElement::setNetworkState(NetworkState state) { |
| 3946 if (m_networkState == state) | 3946 if (m_networkState == state) |
| 3947 return; | 3947 return; |
| 3948 | 3948 |
| 3949 m_networkState = state; | 3949 m_networkState = state; |
| 3950 if (mediaControls()) | 3950 if (mediaControls()) |
| 3951 mediaControls()->networkStateChanged(); | 3951 mediaControls()->networkStateChanged(); |
| 3952 } | 3952 } |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4192 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); | 4192 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); |
| 4193 } | 4193 } |
| 4194 | 4194 |
| 4195 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { | 4195 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { |
| 4196 m_mostlyFillingViewport = true; | 4196 m_mostlyFillingViewport = true; |
| 4197 if (m_webMediaPlayer) | 4197 if (m_webMediaPlayer) |
| 4198 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); | 4198 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); |
| 4199 } | 4199 } |
| 4200 | 4200 |
| 4201 } // namespace blink | 4201 } // namespace blink |
| OLD | NEW |