Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Side by Side Diff: third_party/WebKit/Source/web/RemoteFrameClientImpl.cpp

Issue 1973133002: ✀ Remove postMessage plumbing for swappedout:// ✀ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to use std::move instead of release(). Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "web/RemoteFrameClientImpl.h" 5 #include "web/RemoteFrameClientImpl.h"
6 6
7 #include "core/events/KeyboardEvent.h" 7 #include "core/events/KeyboardEvent.h"
8 #include "core/events/MouseEvent.h" 8 #include "core/events/MouseEvent.h"
9 #include "core/events/WheelEvent.h" 9 #include "core/events/WheelEvent.h"
10 #include "core/frame/RemoteFrame.h" 10 #include "core/frame/RemoteFrame.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 Frame* RemoteFrameClientImpl::firstChild() const 110 Frame* RemoteFrameClientImpl::firstChild() const
111 { 111 {
112 return toCoreFrame(m_webFrame->firstChild()); 112 return toCoreFrame(m_webFrame->firstChild());
113 } 113 }
114 114
115 Frame* RemoteFrameClientImpl::lastChild() const 115 Frame* RemoteFrameClientImpl::lastChild() const
116 { 116 {
117 return toCoreFrame(m_webFrame->lastChild()); 117 return toCoreFrame(m_webFrame->lastChild());
118 } 118 }
119 119
120 bool RemoteFrameClientImpl::willCheckAndDispatchMessageEvent(
121 SecurityOrigin* target, MessageEvent* event, LocalFrame* sourceFrame) const
122 {
123 if (m_webFrame->client())
124 m_webFrame->client()->postMessageEvent(WebLocalFrameImpl::fromFrame(sour ceFrame), m_webFrame, WebSecurityOrigin(target), WebDOMMessageEvent(event));
125 return true;
126 }
127
128 void RemoteFrameClientImpl::frameFocused() const 120 void RemoteFrameClientImpl::frameFocused() const
129 { 121 {
130 if (m_webFrame->client()) 122 if (m_webFrame->client())
131 m_webFrame->client()->frameFocused(); 123 m_webFrame->client()->frameFocused();
132 } 124 }
133 125
134 void RemoteFrameClientImpl::navigate(const ResourceRequest& request, bool should ReplaceCurrentEntry) 126 void RemoteFrameClientImpl::navigate(const ResourceRequest& request, bool should ReplaceCurrentEntry)
135 { 127 {
136 if (m_webFrame->client()) 128 if (m_webFrame->client())
137 m_webFrame->client()->navigate(WrappedResourceRequest(request), shouldRe placeCurrentEntry); 129 m_webFrame->client()->navigate(WrappedResourceRequest(request), shouldRe placeCurrentEntry);
138 } 130 }
139 131
140 void RemoteFrameClientImpl::reload(FrameLoadType loadType, ClientRedirectPolicy clientRedirectPolicy) 132 void RemoteFrameClientImpl::reload(FrameLoadType loadType, ClientRedirectPolicy clientRedirectPolicy)
141 { 133 {
142 ASSERT(loadType == FrameLoadTypeReload || loadType == FrameLoadTypeReloadByp assingCache); 134 ASSERT(loadType == FrameLoadTypeReload || loadType == FrameLoadTypeReloadByp assingCache);
143 if (m_webFrame->client()) 135 if (m_webFrame->client())
144 m_webFrame->client()->reload(static_cast<WebFrameLoadType>(loadType), st atic_cast<WebClientRedirectPolicy>(clientRedirectPolicy)); 136 m_webFrame->client()->reload(static_cast<WebFrameLoadType>(loadType), st atic_cast<WebClientRedirectPolicy>(clientRedirectPolicy));
145 } 137 }
146 138
147 unsigned RemoteFrameClientImpl::backForwardLength() 139 unsigned RemoteFrameClientImpl::backForwardLength()
148 { 140 {
149 // TODO(creis,japhet): This method should return the real value for the 141 // TODO(creis,japhet): This method should return the real value for the
150 // session history length. For now, return static value for the initial 142 // session history length. For now, return static value for the initial
151 // navigation and the subsequent one moving the frame out-of-process. 143 // navigation and the subsequent one moving the frame out-of-process.
152 // See https://crbug.com/501116. 144 // See https://crbug.com/501116.
153 return 2; 145 return 2;
154 } 146 }
155 147
148 void RemoteFrameClientImpl::forwardPostMessage(
149 MessageEvent* event, PassRefPtr<SecurityOrigin> target, LocalFrame* sourceFr ame) const
150 {
151 if (m_webFrame->client())
152 m_webFrame->client()->forwardPostMessage(WebLocalFrameImpl::fromFrame(so urceFrame), m_webFrame, WebSecurityOrigin(target), WebDOMMessageEvent(event));
153 }
154
156 // FIXME: Remove this code once we have input routing in the browser 155 // FIXME: Remove this code once we have input routing in the browser
157 // process. See http://crbug.com/339659. 156 // process. See http://crbug.com/339659.
158 void RemoteFrameClientImpl::forwardInputEvent(Event* event) 157 void RemoteFrameClientImpl::forwardInputEvent(Event* event)
159 { 158 {
160 // It is possible for a platform event to cause the remote iframe element 159 // It is possible for a platform event to cause the remote iframe element
161 // to be hidden, which destroys the layout object (for instance, a mouse 160 // to be hidden, which destroys the layout object (for instance, a mouse
162 // event that moves between elements will trigger a mouseout on the old 161 // event that moves between elements will trigger a mouseout on the old
163 // element, which might hide the new element). In that case we do not 162 // element, which might hide the new element). In that case we do not
164 // forward. This is divergent behavior from local frames, where the 163 // forward. This is divergent behavior from local frames, where the
165 // content of the frame can receive events even after the frame is hidden. 164 // content of the frame can receive events even after the frame is hidden.
(...skipping 29 matching lines...) Expand all
195 { 194 {
196 m_webFrame->client()->advanceFocus(type, WebLocalFrameImpl::fromFrame(source )); 195 m_webFrame->client()->advanceFocus(type, WebLocalFrameImpl::fromFrame(source ));
197 } 196 }
198 197
199 void RemoteFrameClientImpl::visibilityChanged(bool visible) 198 void RemoteFrameClientImpl::visibilityChanged(bool visible)
200 { 199 {
201 m_webFrame->client()->visibilityChanged(visible); 200 m_webFrame->client()->visibilityChanged(visible);
202 } 201 }
203 202
204 } // namespace blink 203 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/RemoteFrameClientImpl.h ('k') | third_party/WebKit/Source/web/tests/FrameTestHelpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698