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 : name(web_frame_owner_properties.name.utf8()), | 22 : name(web_frame_owner_properties.name.utf8()), |
22 scrolling_mode(web_frame_owner_properties.scrollingMode), | 23 scrolling_mode(web_frame_owner_properties.scrollingMode), |
23 margin_width(web_frame_owner_properties.marginWidth), | 24 margin_width(web_frame_owner_properties.marginWidth), |
24 margin_height(web_frame_owner_properties.marginHeight), | 25 margin_height(web_frame_owner_properties.marginHeight), |
25 allow_fullscreen(web_frame_owner_properties.allowFullscreen), | 26 allow_fullscreen(web_frame_owner_properties.allowFullscreen), |
26 allow_payment_request(web_frame_owner_properties.allowPaymentRequest), | 27 allow_payment_request(web_frame_owner_properties.allowPaymentRequest), |
| 28 is_display_none(web_frame_owner_properties.isDisplayNone), |
27 required_csp(web_frame_owner_properties.requiredCsp.utf8()), | 29 required_csp(web_frame_owner_properties.requiredCsp.utf8()), |
28 delegated_permissions( | 30 delegated_permissions( |
29 web_frame_owner_properties.delegatedPermissions.begin(), | 31 web_frame_owner_properties.delegatedPermissions.begin(), |
30 web_frame_owner_properties.delegatedPermissions.end()) {} | 32 web_frame_owner_properties.delegatedPermissions.end()) {} |
31 | 33 |
32 FrameOwnerProperties::~FrameOwnerProperties() {} | 34 FrameOwnerProperties::~FrameOwnerProperties() {} |
33 | 35 |
34 blink::WebFrameOwnerProperties FrameOwnerProperties::ToWebFrameOwnerProperties() | 36 blink::WebFrameOwnerProperties FrameOwnerProperties::ToWebFrameOwnerProperties() |
35 const { | 37 const { |
36 blink::WebFrameOwnerProperties result; | 38 blink::WebFrameOwnerProperties result; |
37 | 39 |
38 result.name = blink::WebString::fromUTF8(name); | 40 result.name = blink::WebString::fromUTF8(name); |
39 result.scrollingMode = scrolling_mode; | 41 result.scrollingMode = scrolling_mode; |
40 result.marginWidth = margin_width; | 42 result.marginWidth = margin_width; |
41 result.marginHeight = margin_height; | 43 result.marginHeight = margin_height; |
42 result.allowFullscreen = allow_fullscreen; | 44 result.allowFullscreen = allow_fullscreen; |
43 result.allowPaymentRequest = allow_payment_request; | 45 result.allowPaymentRequest = allow_payment_request; |
| 46 result.isDisplayNone = is_display_none; |
44 result.requiredCsp = blink::WebString::fromUTF8(required_csp); | 47 result.requiredCsp = blink::WebString::fromUTF8(required_csp); |
45 result.delegatedPermissions = | 48 result.delegatedPermissions = |
46 blink::WebVector<blink::WebPermissionType>(delegated_permissions); | 49 blink::WebVector<blink::WebPermissionType>(delegated_permissions); |
47 | 50 |
48 return result; | 51 return result; |
49 } | 52 } |
50 | 53 |
51 bool FrameOwnerProperties::operator==(const FrameOwnerProperties& other) const { | 54 bool FrameOwnerProperties::operator==(const FrameOwnerProperties& other) const { |
52 return name == other.name && | 55 return name == other.name && |
53 scrolling_mode == other.scrolling_mode && | 56 scrolling_mode == other.scrolling_mode && |
54 margin_width == other.margin_width && | 57 margin_width == other.margin_width && |
55 margin_height == other.margin_height && | 58 margin_height == other.margin_height && |
56 allow_fullscreen == other.allow_fullscreen && | 59 allow_fullscreen == other.allow_fullscreen && |
57 allow_payment_request == other.allow_payment_request && | 60 allow_payment_request == other.allow_payment_request && |
| 61 is_display_none == other.is_display_none && |
58 required_csp == other.required_csp && | 62 required_csp == other.required_csp && |
59 std::equal(delegated_permissions.begin(), delegated_permissions.end(), | 63 std::equal(delegated_permissions.begin(), delegated_permissions.end(), |
60 other.delegated_permissions.begin()); | 64 other.delegated_permissions.begin()); |
61 } | 65 } |
62 | 66 |
63 } // namespace content | 67 } // namespace content |
OLD | NEW |