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 3924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3980 return false; | 3981 return false; |
3981 } | 3982 } |
3982 | 3983 |
3983 return true; | 3984 return true; |
3984 } | 3985 } |
3985 | 3986 |
3986 bool HTMLMediaElement::isAutoplayAllowedPerSettings() const { | 3987 bool HTMLMediaElement::isAutoplayAllowedPerSettings() const { |
3987 LocalFrame* frame = document().frame(); | 3988 LocalFrame* frame = document().frame(); |
3988 if (!frame) | 3989 if (!frame) |
3989 return false; | 3990 return false; |
3990 LocalFrameClient* localFrameClient = frame->loader().client(); | 3991 ContentSettingsClient* settingsClient = frame->contentSettingsClient(); |
dcheng
2017/04/02 05:26:19
Since we already check that we have a frame here,
kinuko
2017/04/03 15:15:06
Done.
| |
3991 return localFrameClient && localFrameClient->allowAutoplay(true); | 3992 return settingsClient && settingsClient->allowAutoplay(true); |
3992 } | 3993 } |
3993 | 3994 |
3994 void HTMLMediaElement::setNetworkState(NetworkState state) { | 3995 void HTMLMediaElement::setNetworkState(NetworkState state) { |
3995 if (m_networkState == state) | 3996 if (m_networkState == state) |
3996 return; | 3997 return; |
3997 | 3998 |
3998 m_networkState = state; | 3999 m_networkState = state; |
3999 if (mediaControls()) | 4000 if (mediaControls()) |
4000 mediaControls()->networkStateChanged(); | 4001 mediaControls()->networkStateChanged(); |
4001 } | 4002 } |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4241 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); | 4242 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); |
4242 } | 4243 } |
4243 | 4244 |
4244 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { | 4245 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { |
4245 m_mostlyFillingViewport = true; | 4246 m_mostlyFillingViewport = true; |
4246 if (m_webMediaPlayer) | 4247 if (m_webMediaPlayer) |
4247 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); | 4248 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); |
4248 } | 4249 } |
4249 | 4250 |
4250 } // namespace blink | 4251 } // namespace blink |
OLD | NEW |