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/AutoplayUmaHelper.h" | 53 #include "core/html/AutoplayUmaHelper.h" |
53 #include "core/html/HTMLMediaSource.h" | 54 #include "core/html/HTMLMediaSource.h" |
54 #include "core/html/HTMLSourceElement.h" | 55 #include "core/html/HTMLSourceElement.h" |
55 #include "core/html/HTMLTrackElement.h" | 56 #include "core/html/HTMLTrackElement.h" |
(...skipping 3870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3926 return false; | 3927 return false; |
3927 } | 3928 } |
3928 | 3929 |
3929 return true; | 3930 return true; |
3930 } | 3931 } |
3931 | 3932 |
3932 bool HTMLMediaElement::isAutoplayAllowedPerSettings() const { | 3933 bool HTMLMediaElement::isAutoplayAllowedPerSettings() const { |
3933 LocalFrame* frame = document().frame(); | 3934 LocalFrame* frame = document().frame(); |
3934 if (!frame) | 3935 if (!frame) |
3935 return false; | 3936 return false; |
3936 LocalFrameClient* localFrameClient = frame->loader().client(); | 3937 return frame->contentSettingsClient()->allowAutoplay(true); |
3937 return localFrameClient && localFrameClient->allowAutoplay(true); | |
3938 } | 3938 } |
3939 | 3939 |
3940 void HTMLMediaElement::setNetworkState(NetworkState state) { | 3940 void HTMLMediaElement::setNetworkState(NetworkState state) { |
3941 if (m_networkState == state) | 3941 if (m_networkState == state) |
3942 return; | 3942 return; |
3943 | 3943 |
3944 m_networkState = state; | 3944 m_networkState = state; |
3945 if (mediaControls()) | 3945 if (mediaControls()) |
3946 mediaControls()->networkStateChanged(); | 3946 mediaControls()->networkStateChanged(); |
3947 } | 3947 } |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4187 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); | 4187 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); |
4188 } | 4188 } |
4189 | 4189 |
4190 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { | 4190 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { |
4191 m_mostlyFillingViewport = true; | 4191 m_mostlyFillingViewport = true; |
4192 if (m_webMediaPlayer) | 4192 if (m_webMediaPlayer) |
4193 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); | 4193 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); |
4194 } | 4194 } |
4195 | 4195 |
4196 } // namespace blink | 4196 } // namespace blink |
OLD | NEW |