| 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 "core/frame/RemoteFrame.h" | 5 #include "core/frame/RemoteFrame.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/WindowProxy.h" | 7 #include "bindings/core/v8/WindowProxy.h" |
| 8 #include "bindings/core/v8/WindowProxyManager.h" | 8 #include "bindings/core/v8/WindowProxyManager.h" |
| 9 #include "core/dom/RemoteSecurityContext.h" | 9 #include "core/dom/RemoteSecurityContext.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 return windowProxy; | 65 return windowProxy; |
| 66 } | 66 } |
| 67 | 67 |
| 68 void RemoteFrame::navigate(Document& originDocument, const KURL& url, bool repla
ceCurrentItem, UserGestureStatus userGestureStatus) | 68 void RemoteFrame::navigate(Document& originDocument, const KURL& url, bool repla
ceCurrentItem, UserGestureStatus userGestureStatus) |
| 69 { | 69 { |
| 70 // The process where this frame actually lives won't have sufficient informa
tion to determine | 70 // The process where this frame actually lives won't have sufficient informa
tion to determine |
| 71 // correct referrer, since it won't have access to the originDocument. Set i
t now. | 71 // correct referrer, since it won't have access to the originDocument. Set i
t now. |
| 72 ResourceRequest request(url); | 72 ResourceRequest request(url); |
| 73 request.setHTTPReferrer(SecurityPolicy::generateReferrer(originDocument.getR
eferrerPolicy(), url, originDocument.outgoingReferrer())); | 73 request.setHTTPReferrer(SecurityPolicy::generateReferrer(originDocument.getR
eferrerPolicy(), url, originDocument.outgoingReferrer())); |
| 74 request.setHasUserGesture(userGestureStatus == UserGestureStatus::Active); | 74 request.setHasUserGesture(userGestureStatus == UserGestureStatus::Active); |
| 75 remoteFrameClient()->navigate(request, replaceCurrentItem); | 75 client()->navigate(request, replaceCurrentItem); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void RemoteFrame::navigate(const FrameLoadRequest& passedRequest) | 78 void RemoteFrame::navigate(const FrameLoadRequest& passedRequest) |
| 79 { | 79 { |
| 80 UserGestureStatus gesture = UserGestureIndicator::processingUserGesture() ?
UserGestureStatus::Active : UserGestureStatus::None; | 80 UserGestureStatus gesture = UserGestureIndicator::processingUserGesture() ?
UserGestureStatus::Active : UserGestureStatus::None; |
| 81 navigate(*passedRequest.originDocument(), passedRequest.resourceRequest().ur
l(), passedRequest.replacesCurrentItem(), gesture); | 81 navigate(*passedRequest.originDocument(), passedRequest.resourceRequest().ur
l(), passedRequest.replacesCurrentItem(), gesture); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void RemoteFrame::reload(FrameLoadType frameLoadType, ClientRedirectPolicy clien
tRedirectPolicy) | 84 void RemoteFrame::reload(FrameLoadType frameLoadType, ClientRedirectPolicy clien
tRedirectPolicy) |
| 85 { | 85 { |
| 86 remoteFrameClient()->reload(frameLoadType, clientRedirectPolicy); | 86 client()->reload(frameLoadType, clientRedirectPolicy); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void RemoteFrame::detach(FrameDetachType type) | 89 void RemoteFrame::detach(FrameDetachType type) |
| 90 { | 90 { |
| 91 PluginScriptForbiddenScope forbidPluginDestructorScripting; | 91 PluginScriptForbiddenScope forbidPluginDestructorScripting; |
| 92 detachChildren(); | 92 detachChildren(); |
| 93 if (!client()) | 93 if (!client()) |
| 94 return; | 94 return; |
| 95 | 95 |
| 96 // Clean up the frame's view if needed. A remote frame only has a view if | 96 // Clean up the frame's view if needed. A remote frame only has a view if |
| (...skipping 21 matching lines...) Expand all Loading... |
| 118 | 118 |
| 119 bool RemoteFrame::shouldClose() | 119 bool RemoteFrame::shouldClose() |
| 120 { | 120 { |
| 121 // TODO(nasko): Implement running the beforeunload handler in the actual | 121 // TODO(nasko): Implement running the beforeunload handler in the actual |
| 122 // LocalFrame running in a different process and getting back a real result. | 122 // LocalFrame running in a different process and getting back a real result. |
| 123 return true; | 123 return true; |
| 124 } | 124 } |
| 125 | 125 |
| 126 void RemoteFrame::forwardInputEvent(Event* event) | 126 void RemoteFrame::forwardInputEvent(Event* event) |
| 127 { | 127 { |
| 128 remoteFrameClient()->forwardInputEvent(event); | 128 client()->forwardInputEvent(event); |
| 129 } | 129 } |
| 130 | 130 |
| 131 void RemoteFrame::frameRectsChanged(const IntRect& frameRect) | 131 void RemoteFrame::frameRectsChanged(const IntRect& frameRect) |
| 132 { | 132 { |
| 133 remoteFrameClient()->frameRectsChanged(frameRect); | 133 client()->frameRectsChanged(frameRect); |
| 134 } | 134 } |
| 135 | 135 |
| 136 void RemoteFrame::visibilityChanged(bool visible) | 136 void RemoteFrame::visibilityChanged(bool visible) |
| 137 { | 137 { |
| 138 if (remoteFrameClient()) | 138 if (client()) |
| 139 remoteFrameClient()->visibilityChanged(visible); | 139 client()->visibilityChanged(visible); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void RemoteFrame::setView(RemoteFrameView* view) | 142 void RemoteFrame::setView(RemoteFrameView* view) |
| 143 { | 143 { |
| 144 // Oilpan: as RemoteFrameView performs no finalization actions, | 144 // Oilpan: as RemoteFrameView performs no finalization actions, |
| 145 // no explicit dispose() of it needed here. (cf. FrameView::dispose().) | 145 // no explicit dispose() of it needed here. (cf. FrameView::dispose().) |
| 146 m_view = view; | 146 m_view = view; |
| 147 | 147 |
| 148 // ... the RemoteDOMWindow will need to be informed of detachment, | 148 // ... the RemoteDOMWindow will need to be informed of detachment, |
| 149 // as otherwise it will keep a strong reference back to this RemoteFrame. | 149 // as otherwise it will keep a strong reference back to this RemoteFrame. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 162 return; | 162 return; |
| 163 | 163 |
| 164 ASSERT(!deprecatedLocalOwner()->ownedWidget()); | 164 ASSERT(!deprecatedLocalOwner()->ownedWidget()); |
| 165 | 165 |
| 166 setView(RemoteFrameView::create(this)); | 166 setView(RemoteFrameView::create(this)); |
| 167 | 167 |
| 168 if (ownerLayoutObject()) | 168 if (ownerLayoutObject()) |
| 169 deprecatedLocalOwner()->setWidget(m_view); | 169 deprecatedLocalOwner()->setWidget(m_view); |
| 170 } | 170 } |
| 171 | 171 |
| 172 RemoteFrameClient* RemoteFrame::remoteFrameClient() const | 172 RemoteFrameClient* RemoteFrame::client() const |
| 173 { | 173 { |
| 174 return static_cast<RemoteFrameClient*>(client()); | 174 return static_cast<RemoteFrameClient*>(Frame::client()); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void RemoteFrame::setRemotePlatformLayer(WebLayer* layer) | 177 void RemoteFrame::setRemotePlatformLayer(WebLayer* layer) |
| 178 { | 178 { |
| 179 if (m_remotePlatformLayer) | 179 if (m_remotePlatformLayer) |
| 180 GraphicsLayer::unregisterContentsLayer(m_remotePlatformLayer); | 180 GraphicsLayer::unregisterContentsLayer(m_remotePlatformLayer); |
| 181 m_remotePlatformLayer = layer; | 181 m_remotePlatformLayer = layer; |
| 182 if (m_remotePlatformLayer) | 182 if (m_remotePlatformLayer) |
| 183 GraphicsLayer::registerContentsLayer(layer); | 183 GraphicsLayer::registerContentsLayer(layer); |
| 184 | 184 |
| 185 ASSERT(owner()); | 185 ASSERT(owner()); |
| 186 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate(); | 186 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate(); |
| 187 } | 187 } |
| 188 | 188 |
| 189 void RemoteFrame::advanceFocus(WebFocusType type, LocalFrame* source) | 189 void RemoteFrame::advanceFocus(WebFocusType type, LocalFrame* source) |
| 190 { | 190 { |
| 191 remoteFrameClient()->advanceFocus(type, source); | 191 client()->advanceFocus(type, source); |
| 192 } | 192 } |
| 193 | 193 |
| 194 } // namespace blink | 194 } // namespace blink |
| OLD | NEW |