| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "content/renderer/frame_owner_properties.h" | 5 #include "content/renderer/frame_owner_properties.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 | 9 |
| 10 #include "third_party/WebKit/public/platform/WebFeaturePolicy.h" | 10 #include "third_party/WebKit/public/platform/WebFeaturePolicy.h" |
| 11 #include "third_party/WebKit/public/platform/modules/permissions/permission.mojo
m.h" | 11 #include "third_party/WebKit/public/platform/modules/permissions/permission.mojo
m.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 FrameOwnerProperties ConvertWebFrameOwnerPropertiesToFrameOwnerProperties( | 15 FrameOwnerProperties ConvertWebFrameOwnerPropertiesToFrameOwnerProperties( |
| 16 const blink::WebFrameOwnerProperties& web_frame_owner_properties) { | 16 const blink::WebFrameOwnerProperties& web_frame_owner_properties) { |
| 17 FrameOwnerProperties result; | 17 FrameOwnerProperties result; |
| 18 | 18 |
| 19 result.name = web_frame_owner_properties.name.utf8(); | 19 result.name = web_frame_owner_properties.name.utf8(); |
| 20 result.scrolling_mode = web_frame_owner_properties.scrollingMode; | 20 result.scrolling_mode = web_frame_owner_properties.scrollingMode; |
| 21 result.margin_width = web_frame_owner_properties.marginWidth; | 21 result.margin_width = web_frame_owner_properties.marginWidth; |
| 22 result.margin_height = web_frame_owner_properties.marginHeight; | 22 result.margin_height = web_frame_owner_properties.marginHeight; |
| 23 result.allow_fullscreen = web_frame_owner_properties.allowFullscreen; | 23 result.allow_fullscreen = web_frame_owner_properties.allowFullscreen; |
| 24 result.allow_payment_request = web_frame_owner_properties.allowPaymentRequest; | 24 result.allow_payment_request = web_frame_owner_properties.allowPaymentRequest; |
| 25 result.required_csp = web_frame_owner_properties.requiredCsp.utf8(); | 25 result.required_csp = web_frame_owner_properties.requiredCsp.utf8(); |
| 26 std::copy(web_frame_owner_properties.delegatedPermissions.begin(), | |
| 27 web_frame_owner_properties.delegatedPermissions.end(), | |
| 28 std::back_inserter(result.delegated_permissions)); | |
| 29 std::copy(web_frame_owner_properties.allowedFeatures.begin(), | 26 std::copy(web_frame_owner_properties.allowedFeatures.begin(), |
| 30 web_frame_owner_properties.allowedFeatures.end(), | 27 web_frame_owner_properties.allowedFeatures.end(), |
| 31 std::back_inserter(result.allowed_features)); | 28 std::back_inserter(result.allowed_features)); |
| 32 | 29 |
| 33 return result; | 30 return result; |
| 34 } | 31 } |
| 35 | 32 |
| 36 blink::WebFrameOwnerProperties | 33 blink::WebFrameOwnerProperties |
| 37 ConvertFrameOwnerPropertiesToWebFrameOwnerProperties( | 34 ConvertFrameOwnerPropertiesToWebFrameOwnerProperties( |
| 38 const FrameOwnerProperties& frame_owner_properties) { | 35 const FrameOwnerProperties& frame_owner_properties) { |
| 39 blink::WebFrameOwnerProperties result; | 36 blink::WebFrameOwnerProperties result; |
| 40 | 37 |
| 41 result.name = blink::WebString::fromUTF8(frame_owner_properties.name); | 38 result.name = blink::WebString::fromUTF8(frame_owner_properties.name); |
| 42 result.scrollingMode = frame_owner_properties.scrolling_mode; | 39 result.scrollingMode = frame_owner_properties.scrolling_mode; |
| 43 result.marginWidth = frame_owner_properties.margin_width; | 40 result.marginWidth = frame_owner_properties.margin_width; |
| 44 result.marginHeight = frame_owner_properties.margin_height; | 41 result.marginHeight = frame_owner_properties.margin_height; |
| 45 result.allowFullscreen = frame_owner_properties.allow_fullscreen; | 42 result.allowFullscreen = frame_owner_properties.allow_fullscreen; |
| 46 result.allowPaymentRequest = frame_owner_properties.allow_payment_request; | 43 result.allowPaymentRequest = frame_owner_properties.allow_payment_request; |
| 47 result.requiredCsp = | 44 result.requiredCsp = |
| 48 blink::WebString::fromUTF8(frame_owner_properties.required_csp); | 45 blink::WebString::fromUTF8(frame_owner_properties.required_csp); |
| 49 result.delegatedPermissions = blink::WebVector<blink::mojom::PermissionName>( | |
| 50 frame_owner_properties.delegated_permissions); | |
| 51 result.allowedFeatures = blink::WebVector<blink::WebFeaturePolicyFeature>( | 46 result.allowedFeatures = blink::WebVector<blink::WebFeaturePolicyFeature>( |
| 52 frame_owner_properties.allowed_features); | 47 frame_owner_properties.allowed_features); |
| 53 | 48 |
| 54 return result; | 49 return result; |
| 55 } | 50 } |
| 56 | 51 |
| 57 } // namespace content | 52 } // namespace content |
| OLD | NEW |