Chromium Code Reviews| Index: third_party/WebKit/Source/web/WebFrame.cpp |
| diff --git a/third_party/WebKit/Source/web/WebFrame.cpp b/third_party/WebKit/Source/web/WebFrame.cpp |
| index 79ce1ac6b9979b00595c6cfcf32f373238e62f1c..da74bdc9f6d7ed9a95289236bac5f6f33fd4f92d 100644 |
| --- a/third_party/WebKit/Source/web/WebFrame.cpp |
| +++ b/third_party/WebKit/Source/web/WebFrame.cpp |
| @@ -5,6 +5,7 @@ |
| #include "public/web/WebFrame.h" |
| #include "bindings/core/v8/WindowProxyManager.h" |
| +#include "core/HTMLNames.h" |
| #include "core/frame/FrameHost.h" |
| #include "core/frame/FrameView.h" |
| #include "core/frame/LocalFrame.h" |
| @@ -21,10 +22,13 @@ |
| #include "web/RemoteFrameOwner.h" |
| #include "web/WebLocalFrameImpl.h" |
| #include "web/WebRemoteFrameImpl.h" |
| +#include "wtf/Optional.h" |
|
bokan
2016/11/21 16:11:36
Remove
|
| #include <algorithm> |
| namespace blink { |
| +using namespace HTMLNames; |
| + |
| bool WebFrame::swap(WebFrame* frame) { |
| using std::swap; |
| Frame* oldFrame = toImplBase()->frame(); |
| @@ -132,12 +136,30 @@ WebInsecureRequestPolicy WebFrame::getInsecureRequestPolicy() const { |
| return toImplBase()->frame()->securityContext()->getInsecureRequestPolicy(); |
| } |
| +ScrollbarMode toScrollbarMode( |
| + WebFrameOwnerProperties::ScrollingMode scrollingMode) { |
| + return static_cast<ScrollbarMode>(scrollingMode); |
|
bokan
2016/11/21 16:11:36
just do this cast inline.
|
| +} |
| + |
| void WebFrame::setFrameOwnerProperties( |
| const WebFrameOwnerProperties& properties) { |
| // At the moment, this is only used to replicate frame owner properties |
| // for frames with a remote owner. |
| RemoteFrameOwner* owner = toRemoteFrameOwner(toImplBase()->frame()->owner()); |
| DCHECK(owner); |
| + |
| + Frame* frame = toImplBase()->frame(); |
| + DCHECK(frame); |
| + |
| + if (frame->isLocalFrame()) { |
| + LocalFrame* localFrame = toLocalFrame(frame); |
| + if (localFrame->document()) { |
| + localFrame->document()->didChangeFrameOwnerProperties( |
| + properties.marginWidth, properties.marginHeight, |
| + toScrollbarMode(properties.scrollingMode)); |
| + } |
| + } |
| + |
| owner->setScrollingMode(properties.scrollingMode); |
| owner->setMarginWidth(properties.marginWidth); |
| owner->setMarginHeight(properties.marginHeight); |