| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/common/frame_owner_properties.h" | 5 #include "content/common/frame_owner_properties.h" |
| 6 | 6 |
| 7 namespace content { | 7 namespace content { |
| 8 | 8 |
| 9 FrameOwnerProperties::FrameOwnerProperties() | 9 FrameOwnerProperties::FrameOwnerProperties() |
| 10 : scrolling_mode(blink::WebFrameOwnerProperties::ScrollingMode::Auto), | 10 : scrolling_mode(blink::WebFrameOwnerProperties::ScrollingMode::Auto), |
| 11 margin_width(-1), | 11 margin_width(-1), |
| 12 margin_height(-1), | 12 margin_height(-1), |
| 13 allow_fullscreen(false), | 13 allow_fullscreen(false), |
| 14 allow_payment_request(false) {} | 14 allow_payment_request(false), |
| 15 is_display_none(false) {} |
| 15 | 16 |
| 16 FrameOwnerProperties::FrameOwnerProperties(const FrameOwnerProperties& other) = | 17 FrameOwnerProperties::FrameOwnerProperties(const FrameOwnerProperties& other) = |
| 17 default; | 18 default; |
| 18 | 19 |
| 19 FrameOwnerProperties::FrameOwnerProperties( | 20 FrameOwnerProperties::FrameOwnerProperties( |
| 20 const blink::WebFrameOwnerProperties& web_frame_owner_properties) | 21 const blink::WebFrameOwnerProperties& web_frame_owner_properties) |
| 21 : scrolling_mode(web_frame_owner_properties.scrollingMode), | 22 : scrolling_mode(web_frame_owner_properties.scrollingMode), |
| 22 margin_width(web_frame_owner_properties.marginWidth), | 23 margin_width(web_frame_owner_properties.marginWidth), |
| 23 margin_height(web_frame_owner_properties.marginHeight), | 24 margin_height(web_frame_owner_properties.marginHeight), |
| 24 allow_fullscreen(web_frame_owner_properties.allowFullscreen), | 25 allow_fullscreen(web_frame_owner_properties.allowFullscreen), |
| 25 allow_payment_request(web_frame_owner_properties.allowPaymentRequest), | 26 allow_payment_request(web_frame_owner_properties.allowPaymentRequest), |
| 27 is_display_none(web_frame_owner_properties.isDisplayNone), |
| 26 required_csp(web_frame_owner_properties.requiredCsp.utf8()), | 28 required_csp(web_frame_owner_properties.requiredCsp.utf8()), |
| 27 delegated_permissions( | 29 delegated_permissions( |
| 28 web_frame_owner_properties.delegatedPermissions.begin(), | 30 web_frame_owner_properties.delegatedPermissions.begin(), |
| 29 web_frame_owner_properties.delegatedPermissions.end()) {} | 31 web_frame_owner_properties.delegatedPermissions.end()) {} |
| 30 | 32 |
| 31 FrameOwnerProperties::~FrameOwnerProperties() {} | 33 FrameOwnerProperties::~FrameOwnerProperties() {} |
| 32 | 34 |
| 33 blink::WebFrameOwnerProperties FrameOwnerProperties::ToWebFrameOwnerProperties() | 35 blink::WebFrameOwnerProperties FrameOwnerProperties::ToWebFrameOwnerProperties() |
| 34 const { | 36 const { |
| 35 blink::WebFrameOwnerProperties result; | 37 blink::WebFrameOwnerProperties result; |
| 36 | 38 |
| 37 result.scrollingMode = scrolling_mode; | 39 result.scrollingMode = scrolling_mode; |
| 38 result.marginWidth = margin_width; | 40 result.marginWidth = margin_width; |
| 39 result.marginHeight = margin_height; | 41 result.marginHeight = margin_height; |
| 40 result.allowFullscreen = allow_fullscreen; | 42 result.allowFullscreen = allow_fullscreen; |
| 41 result.allowPaymentRequest = allow_payment_request; | 43 result.allowPaymentRequest = allow_payment_request; |
| 44 result.isDisplayNone = is_display_none; |
| 42 result.requiredCsp = blink::WebString::fromUTF8(required_csp); | 45 result.requiredCsp = blink::WebString::fromUTF8(required_csp); |
| 43 result.delegatedPermissions = | 46 result.delegatedPermissions = |
| 44 blink::WebVector<blink::WebPermissionType>(delegated_permissions); | 47 blink::WebVector<blink::WebPermissionType>(delegated_permissions); |
| 45 | 48 |
| 46 return result; | 49 return result; |
| 47 } | 50 } |
| 48 | 51 |
| 49 bool FrameOwnerProperties::operator==(const FrameOwnerProperties& other) const { | 52 bool FrameOwnerProperties::operator==(const FrameOwnerProperties& other) const { |
| 50 return scrolling_mode == other.scrolling_mode && | 53 return scrolling_mode == other.scrolling_mode && |
| 51 margin_width == other.margin_width && | 54 margin_width == other.margin_width && |
| 52 margin_height == other.margin_height && | 55 margin_height == other.margin_height && |
| 53 allow_fullscreen == other.allow_fullscreen && | 56 allow_fullscreen == other.allow_fullscreen && |
| 54 allow_payment_request == other.allow_payment_request && | 57 allow_payment_request == other.allow_payment_request && |
| 58 is_display_none == other.is_display_none && |
| 55 required_csp == other.required_csp && | 59 required_csp == other.required_csp && |
| 56 std::equal(delegated_permissions.begin(), delegated_permissions.end(), | 60 std::equal(delegated_permissions.begin(), delegated_permissions.end(), |
| 57 other.delegated_permissions.begin()); | 61 other.delegated_permissions.begin()); |
| 58 } | 62 } |
| 59 | 63 |
| 60 } // namespace content | 64 } // namespace content |
| OLD | NEW |