OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "public/web/WebFrame.h" | 6 #include "public/web/WebFrame.h" |
7 | 7 |
8 #include "bindings/core/v8/WindowProxyManager.h" | 8 #include "bindings/core/v8/WindowProxyManager.h" |
9 #include "core/frame/FrameHost.h" | 9 #include "core/frame/FrameHost.h" |
10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
11 #include "core/frame/LocalFrame.h" | 11 #include "core/frame/LocalFrame.h" |
12 #include "core/frame/RemoteFrame.h" | 12 #include "core/frame/RemoteFrame.h" |
13 #include "core/html/HTMLFrameElementBase.h" | 13 #include "core/html/HTMLFrameElementBase.h" |
14 #include "core/html/HTMLFrameOwnerElement.h" | 14 #include "core/html/HTMLFrameOwnerElement.h" |
15 #include "core/page/Page.h" | 15 #include "core/page/Page.h" |
16 #include "platform/UserGestureIndicator.h" | 16 #include "platform/UserGestureIndicator.h" |
17 #include "platform/heap/Handle.h" | 17 #include "platform/heap/Handle.h" |
18 #include "public/web/WebElement.h" | 18 #include "public/web/WebElement.h" |
19 #include "public/web/WebFrameOwnerProperties.h" | |
19 #include "public/web/WebSandboxFlags.h" | 20 #include "public/web/WebSandboxFlags.h" |
20 #include "web/OpenedFrameTracker.h" | 21 #include "web/OpenedFrameTracker.h" |
21 #include "web/RemoteBridgeFrameOwner.h" | 22 #include "web/RemoteBridgeFrameOwner.h" |
22 #include "web/WebLocalFrameImpl.h" | 23 #include "web/WebLocalFrameImpl.h" |
23 #include "web/WebRemoteFrameImpl.h" | 24 #include "web/WebRemoteFrameImpl.h" |
24 #include <algorithm> | 25 #include <algorithm> |
25 | 26 |
26 namespace blink { | 27 namespace blink { |
27 | 28 |
28 Frame* toCoreFrame(const WebFrame* frame) | 29 Frame* toCoreFrame(const WebFrame* frame) |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 | 130 |
130 void WebFrame::setFrameOwnerSandboxFlags(WebSandboxFlags flags) | 131 void WebFrame::setFrameOwnerSandboxFlags(WebSandboxFlags flags) |
131 { | 132 { |
132 // At the moment, this is only used to replicate sandbox flags | 133 // At the moment, this is only used to replicate sandbox flags |
133 // for frames with a remote owner. | 134 // for frames with a remote owner. |
134 FrameOwner* owner = toCoreFrame(this)->owner(); | 135 FrameOwner* owner = toCoreFrame(this)->owner(); |
135 ASSERT(owner); | 136 ASSERT(owner); |
136 toRemoteBridgeFrameOwner(owner)->setSandboxFlags(static_cast<SandboxFlags>(f lags)); | 137 toRemoteBridgeFrameOwner(owner)->setSandboxFlags(static_cast<SandboxFlags>(f lags)); |
137 } | 138 } |
138 | 139 |
140 void WebFrame::setFrameOwnerProperties(const WebFrameOwnerProperties& frameOwner Properties) | |
141 { | |
142 // At the moment, this is only used to replicate frame owner properties | |
143 // for frames with a remote owner. | |
144 FrameOwner* owner = toCoreFrame(this)->owner(); | |
145 ASSERT(owner); | |
146 toRemoteBridgeFrameOwner(owner)->setScrollingMode(static_cast<ScrollbarMode> (frameOwnerProperties.scrollingMode)); | |
dcheng
2015/10/12 04:50:01
Since all callsites seem to pass in a WebFrameOwne
lazyboy
2015/10/13 21:59:08
Done.
| |
147 | |
148 toRemoteBridgeFrameOwner(owner)->setMarginWidth(frameOwnerProperties.marginW idth); | |
149 toRemoteBridgeFrameOwner(owner)->setMarginHeight(frameOwnerProperties.margin Height); | |
150 } | |
151 | |
139 WebFrame* WebFrame::opener() const | 152 WebFrame* WebFrame::opener() const |
140 { | 153 { |
141 return m_opener; | 154 return m_opener; |
142 } | 155 } |
143 | 156 |
144 void WebFrame::setOpener(WebFrame* opener) | 157 void WebFrame::setOpener(WebFrame* opener) |
145 { | 158 { |
146 if (m_opener) | 159 if (m_opener) |
147 m_opener->m_openedFrameTracker->remove(this); | 160 m_opener->m_openedFrameTracker->remove(this); |
148 if (opener) | 161 if (opener) |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
349 void WebFrame::traceFrames(VisitorDispatcher visitor, WebFrame* frame) { tra ceFramesImpl(visitor, frame); } \ | 362 void WebFrame::traceFrames(VisitorDispatcher visitor, WebFrame* frame) { tra ceFramesImpl(visitor, frame); } \ |
350 void WebFrame::clearWeakFrames(VisitorDispatcher visitor) { clearWeakFramesI mpl(visitor); } | 363 void WebFrame::clearWeakFrames(VisitorDispatcher visitor) { clearWeakFramesI mpl(visitor); } |
351 | 364 |
352 DEFINE_VISITOR_METHOD(Visitor*) | 365 DEFINE_VISITOR_METHOD(Visitor*) |
353 DEFINE_VISITOR_METHOD(InlinedGlobalMarkingVisitor) | 366 DEFINE_VISITOR_METHOD(InlinedGlobalMarkingVisitor) |
354 | 367 |
355 #undef DEFINE_VISITOR_METHOD | 368 #undef DEFINE_VISITOR_METHOD |
356 #endif | 369 #endif |
357 | 370 |
358 } // namespace blink | 371 } // namespace blink |
OLD | NEW |