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