| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 RefPtrWillBeRawPtr<RemoteFrameView> view = RemoteFrameView::create(this); | 145 RefPtrWillBeRawPtr<RemoteFrameView> view = RemoteFrameView::create(this); |
| 146 setView(view); | 146 setView(view); |
| 147 | 147 |
| 148 if (ownerLayoutObject()) { | 148 if (ownerLayoutObject()) { |
| 149 HTMLFrameOwnerElement* owner = deprecatedLocalOwner(); | 149 HTMLFrameOwnerElement* owner = deprecatedLocalOwner(); |
| 150 ASSERT(owner); | 150 ASSERT(owner); |
| 151 owner->setWidget(view); | 151 owner->setWidget(view); |
| 152 } | 152 } |
| 153 } | 153 } |
| 154 | 154 |
| 155 void RemoteFrame::close() |
| 156 { |
| 157 // window.close only makes sense on a top-level frame. |
| 158 if (!tree().parent()) |
| 159 remoteFrameClient()->close(); |
| 160 } |
| 161 |
| 155 RemoteFrameClient* RemoteFrame::remoteFrameClient() const | 162 RemoteFrameClient* RemoteFrame::remoteFrameClient() const |
| 156 { | 163 { |
| 157 return static_cast<RemoteFrameClient*>(client()); | 164 return static_cast<RemoteFrameClient*>(client()); |
| 158 } | 165 } |
| 159 | 166 |
| 160 void RemoteFrame::setRemotePlatformLayer(WebLayer* layer) | 167 void RemoteFrame::setRemotePlatformLayer(WebLayer* layer) |
| 161 { | 168 { |
| 162 if (m_remotePlatformLayer) | 169 if (m_remotePlatformLayer) |
| 163 GraphicsLayer::unregisterContentsLayer(m_remotePlatformLayer); | 170 GraphicsLayer::unregisterContentsLayer(m_remotePlatformLayer); |
| 164 m_remotePlatformLayer = layer; | 171 m_remotePlatformLayer = layer; |
| 165 if (m_remotePlatformLayer) | 172 if (m_remotePlatformLayer) |
| 166 GraphicsLayer::registerContentsLayer(layer); | 173 GraphicsLayer::registerContentsLayer(layer); |
| 167 | 174 |
| 168 ASSERT(owner()); | 175 ASSERT(owner()); |
| 169 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate(); | 176 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate(); |
| 170 if (LayoutPart* layoutObject = ownerLayoutObject()) | 177 if (LayoutPart* layoutObject = ownerLayoutObject()) |
| 171 layoutObject->layer()->updateSelfPaintingLayer(); | 178 layoutObject->layer()->updateSelfPaintingLayer(); |
| 172 } | 179 } |
| 173 | 180 |
| 174 } // namespace blink | 181 } // namespace blink |
| OLD | NEW |