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

Side by Side Diff: Source/web/WebFrame.cpp

Issue 1319863006: (blink) Propagate scrolling/marginwidth/marginheight property values to child frame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address nits Created 5 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/RemoteBridgeFrameOwner.cpp ('k') | Source/web/WebLocalFrameImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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));
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
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
OLDNEW
« no previous file with comments | « Source/web/RemoteBridgeFrameOwner.cpp ('k') | Source/web/WebLocalFrameImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698