| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be found | 2 // Use of this source code is governed by a BSD-style license that can be found |
| 3 // in the LICENSE file. | 3 // in the LICENSE file. |
| 4 | 4 |
| 5 #include "web/RemoteFrameOwner.h" | 5 #include "web/RemoteFrameOwner.h" |
| 6 | 6 |
| 7 #include "core/frame/LocalFrame.h" | 7 #include "core/frame/LocalFrame.h" |
| 8 #include "public/web/WebFrameClient.h" | 8 #include "public/web/WebFrameClient.h" |
| 9 #include "web/WebLocalFrameImpl.h" | 9 #include "web/WebLocalFrameImpl.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 RemoteFrameOwner::RemoteFrameOwner( | 13 RemoteFrameOwner::RemoteFrameOwner( |
| 14 SandboxFlags flags, | 14 SandboxFlags flags, |
| 15 const WebParsedFeaturePolicy& containerPolicy, |
| 15 const WebFrameOwnerProperties& frameOwnerProperties) | 16 const WebFrameOwnerProperties& frameOwnerProperties) |
| 16 : m_sandboxFlags(flags), | 17 : m_sandboxFlags(flags), |
| 17 m_browsingContextContainerName( | 18 m_browsingContextContainerName( |
| 18 static_cast<String>(frameOwnerProperties.name)), | 19 static_cast<String>(frameOwnerProperties.name)), |
| 19 m_scrolling( | 20 m_scrolling( |
| 20 static_cast<ScrollbarMode>(frameOwnerProperties.scrollingMode)), | 21 static_cast<ScrollbarMode>(frameOwnerProperties.scrollingMode)), |
| 21 m_marginWidth(frameOwnerProperties.marginWidth), | 22 m_marginWidth(frameOwnerProperties.marginWidth), |
| 22 m_marginHeight(frameOwnerProperties.marginHeight), | 23 m_marginHeight(frameOwnerProperties.marginHeight), |
| 23 m_allowFullscreen(frameOwnerProperties.allowFullscreen), | 24 m_allowFullscreen(frameOwnerProperties.allowFullscreen), |
| 24 m_allowPaymentRequest(frameOwnerProperties.allowPaymentRequest), | 25 m_allowPaymentRequest(frameOwnerProperties.allowPaymentRequest), |
| 25 m_isDisplayNone(frameOwnerProperties.isDisplayNone), | 26 m_isDisplayNone(frameOwnerProperties.isDisplayNone), |
| 26 m_csp(frameOwnerProperties.requiredCsp) {} | 27 m_csp(frameOwnerProperties.requiredCsp), |
| 28 m_containerPolicy(containerPolicy) {} |
| 27 | 29 |
| 28 DEFINE_TRACE(RemoteFrameOwner) { | 30 DEFINE_TRACE(RemoteFrameOwner) { |
| 29 visitor->trace(m_frame); | 31 visitor->trace(m_frame); |
| 30 FrameOwner::trace(visitor); | 32 FrameOwner::trace(visitor); |
| 31 } | 33 } |
| 32 | 34 |
| 33 void RemoteFrameOwner::setScrollingMode( | 35 void RemoteFrameOwner::setScrollingMode( |
| 34 WebFrameOwnerProperties::ScrollingMode mode) { | 36 WebFrameOwnerProperties::ScrollingMode mode) { |
| 35 m_scrolling = static_cast<ScrollbarMode>(mode); | 37 m_scrolling = static_cast<ScrollbarMode>(mode); |
| 36 } | 38 } |
| 37 | 39 |
| 38 void RemoteFrameOwner::setContentFrame(Frame& frame) { | 40 void RemoteFrameOwner::setContentFrame(Frame& frame) { |
| 39 m_frame = &frame; | 41 m_frame = &frame; |
| 40 } | 42 } |
| 41 | 43 |
| 42 void RemoteFrameOwner::clearContentFrame() { | 44 void RemoteFrameOwner::clearContentFrame() { |
| 43 DCHECK_EQ(m_frame->owner(), this); | 45 DCHECK_EQ(m_frame->owner(), this); |
| 44 m_frame = nullptr; | 46 m_frame = nullptr; |
| 45 } | 47 } |
| 46 | 48 |
| 47 void RemoteFrameOwner::dispatchLoad() { | 49 void RemoteFrameOwner::dispatchLoad() { |
| 48 WebLocalFrameImpl* webFrame = | 50 WebLocalFrameImpl* webFrame = |
| 49 WebLocalFrameImpl::fromFrame(toLocalFrame(*m_frame)); | 51 WebLocalFrameImpl::fromFrame(toLocalFrame(*m_frame)); |
| 50 webFrame->client()->dispatchLoad(); | 52 webFrame->client()->dispatchLoad(); |
| 51 } | 53 } |
| 52 | 54 |
| 53 } // namespace blink | 55 } // namespace blink |
| OLD | NEW |