OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef WebFrameOwnerProperties_h | 5 #ifndef WebFrameOwnerProperties_h |
6 #define WebFrameOwnerProperties_h | 6 #define WebFrameOwnerProperties_h |
7 | 7 |
| 8 #include "public/platform/WebVector.h" |
| 9 #include "public/platform/modules/permissions/WebPermissionType.h" |
| 10 #include <algorithm> |
| 11 |
8 namespace blink { | 12 namespace blink { |
9 | 13 |
10 struct WebFrameOwnerProperties { | 14 struct WebFrameOwnerProperties { |
11 enum class ScrollingMode { | 15 enum class ScrollingMode { |
12 Auto, | 16 Auto, |
13 AlwaysOff, | 17 AlwaysOff, |
14 AlwaysOn, | 18 AlwaysOn, |
15 Last = AlwaysOn | 19 Last = AlwaysOn |
16 }; | 20 }; |
17 | 21 |
18 ScrollingMode scrollingMode; | 22 ScrollingMode scrollingMode; |
19 int marginWidth; | 23 int marginWidth; |
20 int marginHeight; | 24 int marginHeight; |
21 bool allowFullscreen; | 25 bool allowFullscreen; |
| 26 WebVector<WebPermissionType> delegatedPermissions; |
22 | 27 |
23 WebFrameOwnerProperties() | 28 WebFrameOwnerProperties() |
24 : scrollingMode(ScrollingMode::Auto) | 29 : scrollingMode(ScrollingMode::Auto) |
25 , marginWidth(-1) | 30 , marginWidth(-1) |
26 , marginHeight(-1) | 31 , marginHeight(-1) |
27 , allowFullscreen(false) | 32 , allowFullscreen(false) |
28 { | 33 { |
29 } | 34 } |
30 | 35 |
31 #if INSIDE_BLINK | 36 #if INSIDE_BLINK |
32 WebFrameOwnerProperties(ScrollbarMode scrollingMode, int marginWidth, int ma
rginHeight, bool allowFullscreen) | 37 WebFrameOwnerProperties(ScrollbarMode scrollingMode, int marginWidth, int ma
rginHeight, bool allowFullscreen, const WebVector<WebPermissionType>& delegatedP
ermissions) |
33 : scrollingMode(static_cast<ScrollingMode>(scrollingMode)) | 38 : scrollingMode(static_cast<ScrollingMode>(scrollingMode)) |
34 , marginWidth(marginWidth) | 39 , marginWidth(marginWidth) |
35 , marginHeight(marginHeight) | 40 , marginHeight(marginHeight) |
36 , allowFullscreen(allowFullscreen) | 41 , allowFullscreen(allowFullscreen) |
| 42 , delegatedPermissions(delegatedPermissions) |
37 { | 43 { |
38 } | 44 } |
39 #endif | 45 #endif |
40 | 46 |
41 bool operator==(const WebFrameOwnerProperties& other) const | 47 bool operator==(const WebFrameOwnerProperties& other) const |
42 { | 48 { |
43 return scrollingMode == other.scrollingMode | 49 return scrollingMode == other.scrollingMode |
44 && marginWidth == other.marginWidth | 50 && marginWidth == other.marginWidth |
45 && marginHeight == other.marginHeight | 51 && marginHeight == other.marginHeight |
46 && allowFullscreen == other.allowFullscreen; | 52 && allowFullscreen == other.allowFullscreen |
| 53 && std::equal(delegatedPermissions.begin(), |
| 54 delegatedPermissions.end(), |
| 55 other.delegatedPermissions.begin()); |
47 } | 56 } |
48 | 57 |
49 bool operator!=(const WebFrameOwnerProperties& other) const | 58 bool operator!=(const WebFrameOwnerProperties& other) const |
50 { | 59 { |
51 return !(*this == other); | 60 return !(*this == other); |
52 } | 61 } |
53 }; | 62 }; |
54 | 63 |
55 } // namespace blink | 64 } // namespace blink |
56 | 65 |
57 #endif | 66 #endif |
OLD | NEW |