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 "core/dom/RemoteSecurityContext.h" | 8 #include "core/dom/RemoteSecurityContext.h" |
9 #include "core/frame/RemoteDOMWindow.h" | 9 #include "core/frame/RemoteDOMWindow.h" |
10 #include "core/frame/RemoteFrameClient.h" | 10 #include "core/frame/RemoteFrameClient.h" |
11 #include "core/frame/RemoteFrameView.h" | 11 #include "core/frame/RemoteFrameView.h" |
12 #include "core/html/HTMLFrameOwnerElement.h" | 12 #include "core/html/HTMLFrameOwnerElement.h" |
| 13 #include "core/rendering/RenderLayer.h" |
| 14 #include "core/rendering/RenderPart.h" |
| 15 #include "platform/graphics/GraphicsLayer.h" |
13 #include "platform/weborigin/SecurityPolicy.h" | 16 #include "platform/weborigin/SecurityPolicy.h" |
| 17 #include "public/platform/WebLayer.h" |
14 | 18 |
15 namespace blink { | 19 namespace blink { |
16 | 20 |
17 inline RemoteFrame::RemoteFrame(RemoteFrameClient* client, FrameHost* host, Fram
eOwner* owner) | 21 inline RemoteFrame::RemoteFrame(RemoteFrameClient* client, FrameHost* host, Fram
eOwner* owner) |
18 : Frame(client, host, owner) | 22 : Frame(client, host, owner) |
19 , m_securityContext(RemoteSecurityContext::create()) | 23 , m_securityContext(RemoteSecurityContext::create()) |
20 , m_domWindow(RemoteDOMWindow::create(*this)) | 24 , m_domWindow(RemoteDOMWindow::create(*this)) |
21 { | 25 { |
22 } | 26 } |
23 | 27 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 if (!client()) | 67 if (!client()) |
64 return; | 68 return; |
65 Frame::detach(); | 69 Frame::detach(); |
66 } | 70 } |
67 | 71 |
68 RemoteSecurityContext* RemoteFrame::securityContext() const | 72 RemoteSecurityContext* RemoteFrame::securityContext() const |
69 { | 73 { |
70 return m_securityContext.get(); | 74 return m_securityContext.get(); |
71 } | 75 } |
72 | 76 |
| 77 void RemoteFrame::disconnectOwnerElement() |
| 78 { |
| 79 if (owner() && owner()->isLocal()) |
| 80 setRemotePlatformLayer(nullptr); |
| 81 Frame::disconnectOwnerElement(); |
| 82 } |
| 83 |
73 void RemoteFrame::forwardInputEvent(Event* event) | 84 void RemoteFrame::forwardInputEvent(Event* event) |
74 { | 85 { |
75 remoteFrameClient()->forwardInputEvent(event); | 86 remoteFrameClient()->forwardInputEvent(event); |
76 } | 87 } |
77 | 88 |
78 void RemoteFrame::setView(PassRefPtrWillBeRawPtr<RemoteFrameView> view) | 89 void RemoteFrame::setView(PassRefPtrWillBeRawPtr<RemoteFrameView> view) |
79 { | 90 { |
80 // Oilpan: as RemoteFrameView performs no finalization actions, | 91 // Oilpan: as RemoteFrameView performs no finalization actions, |
81 // no explicit dispose() of it needed here. (cf. FrameView::dispose().) | 92 // no explicit dispose() of it needed here. (cf. FrameView::dispose().) |
82 m_view = view; | 93 m_view = view; |
83 } | 94 } |
84 | 95 |
85 void RemoteFrame::createView() | 96 void RemoteFrame::createView() |
86 { | 97 { |
87 RefPtrWillBeRawPtr<RemoteFrameView> view = RemoteFrameView::create(this); | 98 RefPtrWillBeRawPtr<RemoteFrameView> view = RemoteFrameView::create(this); |
88 setView(view); | 99 setView(view); |
89 | 100 |
90 if (ownerRenderer()) { | 101 if (ownerRenderer()) { |
91 HTMLFrameOwnerElement* owner = deprecatedLocalOwner(); | 102 HTMLFrameOwnerElement* owner = deprecatedLocalOwner(); |
92 ASSERT(owner); | 103 ASSERT(owner); |
93 owner->setWidget(view); | 104 owner->setWidget(view); |
94 } | 105 } |
95 } | 106 } |
96 | 107 |
97 RemoteFrameClient* RemoteFrame::remoteFrameClient() const | 108 RemoteFrameClient* RemoteFrame::remoteFrameClient() const |
98 { | 109 { |
99 return static_cast<RemoteFrameClient*>(client()); | 110 return static_cast<RemoteFrameClient*>(client()); |
100 } | 111 } |
101 | 112 |
| 113 void RemoteFrame::setRemotePlatformLayer(WebLayer* layer) |
| 114 { |
| 115 if (m_remotePlatformLayer) |
| 116 GraphicsLayer::unregisterContentsLayer(m_remotePlatformLayer); |
| 117 m_remotePlatformLayer = layer; |
| 118 if (m_remotePlatformLayer) |
| 119 GraphicsLayer::registerContentsLayer(layer); |
| 120 |
| 121 ASSERT(owner()); |
| 122 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate(); |
| 123 if (RenderPart* renderer = ownerRenderer()) |
| 124 renderer->layer()->updateSelfPaintingLayer(); |
| 125 } |
| 126 |
102 } // namespace blink | 127 } // namespace blink |
OLD | NEW |