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/RemoteBridgeFrameOwner.h" | 5 #include "web/RemoteBridgeFrameOwner.h" |
6 | 6 |
| 7 #include "core/frame/LocalFrame.h" |
7 #include "public/web/WebFrameClient.h" | 8 #include "public/web/WebFrameClient.h" |
| 9 #include "web/WebLocalFrameImpl.h" |
8 | 10 |
9 namespace blink { | 11 namespace blink { |
10 | 12 |
11 RemoteBridgeFrameOwner::RemoteBridgeFrameOwner(PassRefPtrWillBeRawPtr<WebLocalFr
ameImpl> frame, SandboxFlags flags, const WebFrameOwnerProperties& frameOwnerPro
perties) | 13 RemoteBridgeFrameOwner::RemoteBridgeFrameOwner(SandboxFlags flags, const WebFram
eOwnerProperties& frameOwnerProperties) |
12 : m_frame(frame) | 14 : m_sandboxFlags(flags) |
13 , m_sandboxFlags(flags) | |
14 , m_scrolling(static_cast<ScrollbarMode>(frameOwnerProperties.scrollingMode)
) | 15 , m_scrolling(static_cast<ScrollbarMode>(frameOwnerProperties.scrollingMode)
) |
15 , m_marginWidth(frameOwnerProperties.marginWidth) | 16 , m_marginWidth(frameOwnerProperties.marginWidth) |
16 , m_marginHeight(frameOwnerProperties.marginHeight) | 17 , m_marginHeight(frameOwnerProperties.marginHeight) |
17 { | 18 { |
18 } | 19 } |
19 | 20 |
20 DEFINE_TRACE(RemoteBridgeFrameOwner) | 21 DEFINE_TRACE(RemoteBridgeFrameOwner) |
21 { | 22 { |
22 visitor->trace(m_frame); | 23 visitor->trace(m_frame); |
23 FrameOwner::trace(visitor); | 24 FrameOwner::trace(visitor); |
24 } | 25 } |
25 | 26 |
26 void RemoteBridgeFrameOwner::setScrollingMode(WebFrameOwnerProperties::Scrolling
Mode mode) | 27 void RemoteBridgeFrameOwner::setScrollingMode(WebFrameOwnerProperties::Scrolling
Mode mode) |
27 { | 28 { |
28 m_scrolling = static_cast<ScrollbarMode>(mode); | 29 m_scrolling = static_cast<ScrollbarMode>(mode); |
29 } | 30 } |
30 | 31 |
| 32 void RemoteBridgeFrameOwner::setContentFrame(Frame& frame) |
| 33 { |
| 34 m_frame = &frame; |
| 35 } |
| 36 |
| 37 void RemoteBridgeFrameOwner::clearContentFrame() |
| 38 { |
| 39 ASSERT(m_frame->owner() == this); |
| 40 m_frame = nullptr; |
| 41 } |
| 42 |
31 void RemoteBridgeFrameOwner::dispatchLoad() | 43 void RemoteBridgeFrameOwner::dispatchLoad() |
32 { | 44 { |
33 if (m_frame->client()) | 45 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(toLocalFrame(*m_f
rame)); |
34 m_frame->client()->dispatchLoad(); | 46 webFrame->client()->dispatchLoad(); |
35 } | 47 } |
36 | 48 |
37 } // namespace blink | 49 } // namespace blink |
OLD | NEW |