Chromium Code Reviews| 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 kScrollBoundaryBehaviorTypeAuto = 0x0, | |
|
bokan
2017/05/19 19:35:57
You can leave the values off since they're the def
sunyunjia
2017/05/25 20:07:10
Done.
| |
| 15 kScrollBoundaryBehaviorTypeContain = 0x1, | |
| 16 kScrollBoundaryBehaviorTypeNone = 0x2 | |
| 17 }; | |
| 18 | |
| 19 ScrollBoundaryBehavior() | |
| 20 : x(kScrollBoundaryBehaviorTypeAuto), | |
| 21 y(kScrollBoundaryBehaviorTypeAuto) {} | |
| 22 ScrollBoundaryBehavior(ScrollBoundaryBehaviorType type) : x(type), y(type) {} | |
|
bokan
2017/05/19 19:35:57
Make this explicit.
sunyunjia
2017/05/25 20:07:10
Done.
| |
| 23 ScrollBoundaryBehavior(ScrollBoundaryBehaviorType x_type, | |
| 24 ScrollBoundaryBehaviorType y_type) | |
| 25 : x(x_type), y(y_type) {} | |
| 26 | |
| 27 ScrollBoundaryBehaviorType x; | |
| 28 ScrollBoundaryBehaviorType y; | |
| 29 | |
| 30 bool operator==(const ScrollBoundaryBehavior& a) const { | |
| 31 return (a.x == x) && (a.y == y); | |
| 32 } | |
| 33 bool operator!=(const ScrollBoundaryBehavior& a) const { | |
| 34 return (a.x != x) || (a.y != y); | |
|
bokan
2017/05/19 19:35:57
You can reuse operator==: return !(*this == a)
sunyunjia
2017/05/25 20:07:10
Done.
| |
| 35 } | |
| 36 }; | |
| 37 | |
| 38 } // namespace cc | |
| 39 | |
| 40 #endif // CC_INPUT_SCROLL_BOUNDARY_BEHAVIOR_H_ | |
| OLD | NEW |