Chromium Code Reviews| 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 "core/frame/RemoteFrame.h" | 6 #include "core/frame/RemoteFrame.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/WindowProxy.h" | 8 #include "bindings/core/v8/WindowProxy.h" |
| 9 #include "bindings/core/v8/WindowProxyManager.h" | 9 #include "bindings/core/v8/WindowProxyManager.h" |
| 10 #include "core/dom/RemoteSecurityContext.h" | 10 #include "core/dom/RemoteSecurityContext.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 143 RefPtrWillBeRawPtr<RemoteFrameView> view = RemoteFrameView::create(this); | 143 RefPtrWillBeRawPtr<RemoteFrameView> view = RemoteFrameView::create(this); |
| 144 setView(view); | 144 setView(view); |
| 145 | 145 |
| 146 if (ownerLayoutObject()) { | 146 if (ownerLayoutObject()) { |
| 147 HTMLFrameOwnerElement* owner = deprecatedLocalOwner(); | 147 HTMLFrameOwnerElement* owner = deprecatedLocalOwner(); |
| 148 ASSERT(owner); | 148 ASSERT(owner); |
| 149 owner->setWidget(view); | 149 owner->setWidget(view); |
| 150 } | 150 } |
| 151 } | 151 } |
| 152 | 152 |
| 153 void RemoteFrame::close() | |
| 154 { | |
| 155 // window.close only makes sense on a top-level frame. | |
| 156 if (!tree().parent()) | |
| 157 remoteFrameClient()->close(); | |
|
dcheng
2015/06/10 20:10:41
LocalDOMWindow::close() has a bunch of other stuff
nasko
2015/06/11 00:04:39
I've added those to RemoteDOMWindow.
dcheng
2015/06/11 02:00:06
Well... but we can change that to do what we need.
| |
| 158 } | |
| 159 | |
| 153 RemoteFrameClient* RemoteFrame::remoteFrameClient() const | 160 RemoteFrameClient* RemoteFrame::remoteFrameClient() const |
| 154 { | 161 { |
| 155 return static_cast<RemoteFrameClient*>(client()); | 162 return static_cast<RemoteFrameClient*>(client()); |
| 156 } | 163 } |
| 157 | 164 |
| 158 void RemoteFrame::setRemotePlatformLayer(WebLayer* layer) | 165 void RemoteFrame::setRemotePlatformLayer(WebLayer* layer) |
| 159 { | 166 { |
| 160 if (m_remotePlatformLayer) | 167 if (m_remotePlatformLayer) |
| 161 GraphicsLayer::unregisterContentsLayer(m_remotePlatformLayer); | 168 GraphicsLayer::unregisterContentsLayer(m_remotePlatformLayer); |
| 162 m_remotePlatformLayer = layer; | 169 m_remotePlatformLayer = layer; |
| 163 if (m_remotePlatformLayer) | 170 if (m_remotePlatformLayer) |
| 164 GraphicsLayer::registerContentsLayer(layer); | 171 GraphicsLayer::registerContentsLayer(layer); |
| 165 | 172 |
| 166 ASSERT(owner()); | 173 ASSERT(owner()); |
| 167 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate(); | 174 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate(); |
| 168 if (LayoutPart* layoutObject = ownerLayoutObject()) | 175 if (LayoutPart* layoutObject = ownerLayoutObject()) |
| 169 layoutObject->layer()->updateSelfPaintingLayer(); | 176 layoutObject->layer()->updateSelfPaintingLayer(); |
| 170 } | 177 } |
| 171 | 178 |
| 172 } // namespace blink | 179 } // namespace blink |
| OLD | NEW |