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