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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp

Issue 2786673002: Separate ContentSettingsClient out from LocalFrameClient (Closed)
Patch Set: added class-level comment 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
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
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrameClient.h ('k') | third_party/WebKit/Source/core/html/ImageDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698