| 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& container_policy, |
| 15 const WebFrameOwnerProperties& frame_owner_properties) | 16 const WebFrameOwnerProperties& frame_owner_properties) |
| 16 : sandbox_flags_(flags), | 17 : sandbox_flags_(flags), |
| 17 browsing_context_container_name_( | 18 browsing_context_container_name_( |
| 18 static_cast<String>(frame_owner_properties.name)), | 19 static_cast<String>(frame_owner_properties.name)), |
| 19 scrolling_( | 20 scrolling_( |
| 20 static_cast<ScrollbarMode>(frame_owner_properties.scrolling_mode)), | 21 static_cast<ScrollbarMode>(frame_owner_properties.scrolling_mode)), |
| 21 margin_width_(frame_owner_properties.margin_width), | 22 margin_width_(frame_owner_properties.margin_width), |
| 22 margin_height_(frame_owner_properties.margin_height), | 23 margin_height_(frame_owner_properties.margin_height), |
| 23 allow_fullscreen_(frame_owner_properties.allow_fullscreen), | 24 allow_fullscreen_(frame_owner_properties.allow_fullscreen), |
| 24 allow_payment_request_(frame_owner_properties.allow_payment_request), | 25 allow_payment_request_(frame_owner_properties.allow_payment_request), |
| 25 is_display_none_(frame_owner_properties.is_display_none), | 26 is_display_none_(frame_owner_properties.is_display_none), |
| 26 csp_(frame_owner_properties.required_csp) {} | 27 csp_(frame_owner_properties.required_csp), |
| 28 container_policy_(container_policy) {} |
| 27 | 29 |
| 28 DEFINE_TRACE(RemoteFrameOwner) { | 30 DEFINE_TRACE(RemoteFrameOwner) { |
| 29 visitor->Trace(frame_); | 31 visitor->Trace(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 scrolling_ = static_cast<ScrollbarMode>(mode); | 37 scrolling_ = static_cast<ScrollbarMode>(mode); |
| 36 } | 38 } |
| 37 | 39 |
| 38 void RemoteFrameOwner::SetContentFrame(Frame& frame) { | 40 void RemoteFrameOwner::SetContentFrame(Frame& frame) { |
| 39 frame_ = &frame; | 41 frame_ = &frame; |
| 40 } | 42 } |
| 41 | 43 |
| 42 void RemoteFrameOwner::ClearContentFrame() { | 44 void RemoteFrameOwner::ClearContentFrame() { |
| 43 DCHECK_EQ(frame_->Owner(), this); | 45 DCHECK_EQ(frame_->Owner(), this); |
| 44 frame_ = nullptr; | 46 frame_ = nullptr; |
| 45 } | 47 } |
| 46 | 48 |
| 47 void RemoteFrameOwner::DispatchLoad() { | 49 void RemoteFrameOwner::DispatchLoad() { |
| 48 WebLocalFrameImpl* web_frame = | 50 WebLocalFrameImpl* web_frame = |
| 49 WebLocalFrameImpl::FromFrame(ToLocalFrame(*frame_)); | 51 WebLocalFrameImpl::FromFrame(ToLocalFrame(*frame_)); |
| 50 web_frame->Client()->DispatchLoad(); | 52 web_frame->Client()->DispatchLoad(); |
| 51 } | 53 } |
| 52 | 54 |
| 53 } // namespace blink | 55 } // namespace blink |
| OLD | NEW |