OLD | NEW |
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef CC_INPUT_SCROLL_BOUNDARY_BEHAVIOR_H_ | 5 #ifndef CC_INPUT_SCROLL_BOUNDARY_BEHAVIOR_H_ |
6 #define CC_INPUT_SCROLL_BOUNDARY_BEHAVIOR_H_ | 6 #define CC_INPUT_SCROLL_BOUNDARY_BEHAVIOR_H_ |
7 | 7 |
8 #include "cc/cc_export.h" | 8 #include "cc/cc_export.h" |
9 | 9 |
10 namespace cc { | 10 namespace cc { |
11 | 11 |
12 struct CC_EXPORT ScrollBoundaryBehavior { | 12 struct CC_EXPORT ScrollBoundaryBehavior { |
13 enum ScrollBoundaryBehaviorType { | 13 enum ScrollBoundaryBehaviorType { |
14 // Same as contain but also hint that no overscroll affordance should be | 14 // Same as contain but also hint that no overscroll affordance should be |
15 // triggered. | 15 // triggered. |
16 kScrollBoundaryBehaviorTypeNone, | 16 kScrollBoundaryBehaviorTypeNone, |
17 // Allows the default behavior for the user agent. | 17 // Allows the default behavior for the user agent. |
18 kScrollBoundaryBehaviorTypeAuto, | 18 kScrollBoundaryBehaviorTypeAuto, |
19 // Hint to disable scroll chaining. The user agent may show an appropriate | 19 // Hint to disable scroll chaining. The user agent may show an appropriate |
20 // overscroll affordance. | 20 // overscroll affordance. |
21 kScrollBoundaryBehaviorTypeContain | 21 kScrollBoundaryBehaviorTypeContain, |
| 22 kScrollBoundaryBehaviorTypeMax = kScrollBoundaryBehaviorTypeContain |
22 }; | 23 }; |
23 | 24 |
24 ScrollBoundaryBehavior() | 25 ScrollBoundaryBehavior() |
25 : x(kScrollBoundaryBehaviorTypeAuto), | 26 : x(kScrollBoundaryBehaviorTypeAuto), |
26 y(kScrollBoundaryBehaviorTypeAuto) {} | 27 y(kScrollBoundaryBehaviorTypeAuto) {} |
27 explicit ScrollBoundaryBehavior(ScrollBoundaryBehaviorType type) | 28 explicit ScrollBoundaryBehavior(ScrollBoundaryBehaviorType type) |
28 : x(type), y(type) {} | 29 : x(type), y(type) {} |
29 ScrollBoundaryBehavior(ScrollBoundaryBehaviorType x_type, | 30 ScrollBoundaryBehavior(ScrollBoundaryBehaviorType x_type, |
30 ScrollBoundaryBehaviorType y_type) | 31 ScrollBoundaryBehaviorType y_type) |
31 : x(x_type), y(y_type) {} | 32 : x(x_type), y(y_type) {} |
32 | 33 |
33 ScrollBoundaryBehaviorType x; | 34 ScrollBoundaryBehaviorType x; |
34 ScrollBoundaryBehaviorType y; | 35 ScrollBoundaryBehaviorType y; |
35 | 36 |
36 bool operator==(const ScrollBoundaryBehavior& a) const { | 37 bool operator==(const ScrollBoundaryBehavior& a) const { |
37 return (a.x == x) && (a.y == y); | 38 return (a.x == x) && (a.y == y); |
38 } | 39 } |
39 bool operator!=(const ScrollBoundaryBehavior& a) const { | 40 bool operator!=(const ScrollBoundaryBehavior& a) const { |
40 return !(*this == a); | 41 return !(*this == a); |
41 } | 42 } |
42 }; | 43 }; |
43 | 44 |
44 } // namespace cc | 45 } // namespace cc |
45 | 46 |
46 #endif // CC_INPUT_SCROLL_BOUNDARY_BEHAVIOR_H_ | 47 #endif // CC_INPUT_SCROLL_BOUNDARY_BEHAVIOR_H_ |
OLD | NEW |