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 "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" |
11 #include "core/frame/RemoteFrameView.h" | 11 #include "core/frame/RemoteFrameView.h" |
12 #include "core/layout/LayoutPart.h" | 12 #include "core/layout/LayoutPart.h" |
13 #include "core/layout/api/LayoutItem.h" | 13 #include "core/layout/api/LayoutItem.h" |
14 #include "platform/exported/WrappedResourceRequest.h" | 14 #include "platform/exported/WrappedResourceRequest.h" |
| 15 #include "platform/weborigin/KURL.h" |
15 #include "platform/weborigin/SecurityOrigin.h" | 16 #include "platform/weborigin/SecurityOrigin.h" |
16 #include "platform/weborigin/SecurityPolicy.h" | 17 #include "platform/weborigin/SecurityPolicy.h" |
| 18 #include "public/platform/WebString.h" |
| 19 #include "public/platform/WebVector.h" |
| 20 #include "public/web/WebContentSecurityPolicy.h" |
17 #include "public/web/WebRemoteFrameClient.h" | 21 #include "public/web/WebRemoteFrameClient.h" |
18 #include "web/WebInputEventConversion.h" | 22 #include "web/WebInputEventConversion.h" |
19 #include "web/WebLocalFrameImpl.h" | 23 #include "web/WebLocalFrameImpl.h" |
20 #include "web/WebRemoteFrameImpl.h" | 24 #include "web/WebRemoteFrameImpl.h" |
21 #include "wtf/PtrUtil.h" | 25 #include "wtf/PtrUtil.h" |
| 26 #include "wtf/text/WTFString.h" |
22 #include <memory> | 27 #include <memory> |
23 | 28 |
24 namespace blink { | 29 namespace blink { |
25 | 30 |
26 namespace { | 31 namespace { |
27 | 32 |
28 // Convenience helper for frame tree helpers in FrameClient to reduce the amount | 33 // Convenience helper for frame tree helpers in FrameClient to reduce the amount |
29 // of null-checking boilerplate code. Since the frame tree is maintained in the | 34 // of null-checking boilerplate code. Since the frame tree is maintained in the |
30 // web/ layer, the frame tree helpers often have to deal with null WebFrames: | 35 // web/ layer, the frame tree helpers often have to deal with null WebFrames: |
31 // for example, a frame with no parent will return null for WebFrame::parent(). | 36 // for example, a frame with no parent will return null for WebFrame::parent(). |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 void RemoteFrameClientImpl::advanceFocus(WebFocusType type, LocalFrame* source) | 200 void RemoteFrameClientImpl::advanceFocus(WebFocusType type, LocalFrame* source) |
196 { | 201 { |
197 m_webFrame->client()->advanceFocus(type, WebLocalFrameImpl::fromFrame(source
)); | 202 m_webFrame->client()->advanceFocus(type, WebLocalFrameImpl::fromFrame(source
)); |
198 } | 203 } |
199 | 204 |
200 void RemoteFrameClientImpl::visibilityChanged(bool visible) | 205 void RemoteFrameClientImpl::visibilityChanged(bool visible) |
201 { | 206 { |
202 m_webFrame->client()->visibilityChanged(visible); | 207 m_webFrame->client()->visibilityChanged(visible); |
203 } | 208 } |
204 | 209 |
| 210 void RemoteFrameClientImpl::forwardContentSecurityPolicyViolation(const String&
directiveText, const String& effectiveDirective, const String& consoleMessage, c
onst KURL& blockedURL, const Vector<String>& reportEndpoints, const String& head
er, ContentSecurityPolicy::ViolationType violationType, bool followedRedirect) |
| 211 { |
| 212 WebVector<WebString> webReportEndpoints(reportEndpoints.size()); |
| 213 for (size_t i = 0; i < reportEndpoints.size(); i++) |
| 214 webReportEndpoints[i] = reportEndpoints[i]; |
| 215 |
| 216 m_webFrame->client()->forwardContentSecurityPolicyViolation( |
| 217 directiveText, |
| 218 effectiveDirective, |
| 219 consoleMessage, |
| 220 blockedURL, |
| 221 webReportEndpoints, |
| 222 header, |
| 223 static_cast<WebContentSecurityPolicyViolationType>(violationType), |
| 224 followedRedirect); |
| 225 } |
| 226 |
205 } // namespace blink | 227 } // namespace blink |
OLD | NEW |