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 CC_INPUT_SCROLL_STATE_DATA_H_ | 5 #ifndef CC_INPUT_SCROLL_STATE_DATA_H_ |
6 #define CC_INPUT_SCROLL_STATE_DATA_H_ | 6 #define CC_INPUT_SCROLL_STATE_DATA_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 // TODO(tdresser): ScrollState shouldn't need to keep track of whether or not | 53 // TODO(tdresser): ScrollState shouldn't need to keep track of whether or not |
54 // this ScrollState object has caused a scroll. Ideally, any native scroller | 54 // this ScrollState object has caused a scroll. Ideally, any native scroller |
55 // consuming delta has caused a scroll. Currently, there are some cases where | 55 // consuming delta has caused a scroll. Currently, there are some cases where |
56 // we consume delta without scrolling, such as in | 56 // we consume delta without scrolling, such as in |
57 // |Viewport::AdjustOverscroll|. Once these cases are fixed, we should get rid | 57 // |Viewport::AdjustOverscroll|. Once these cases are fixed, we should get rid |
58 // of |caused_scroll_*_|. See crbug.com/510045 for details. | 58 // of |caused_scroll_*_|. See crbug.com/510045 for details. |
59 bool caused_scroll_x; | 59 bool caused_scroll_x; |
60 bool caused_scroll_y; | 60 bool caused_scroll_y; |
61 | 61 |
| 62 // Track if the scroll_chain has been cut by scroll_boundary_behavior, in |
| 63 // order to properly handle overscroll-effects. |
| 64 // TODO(sunyunjia): overscroll should be handled at the top of scroll_chain, |
| 65 // as implemented at blink side. This field should be removed after it's |
| 66 // resolved. crbug.com/755164. |
| 67 bool is_scroll_chain_cut; |
| 68 |
62 ScrollNode* current_native_scrolling_node() const; | 69 ScrollNode* current_native_scrolling_node() const; |
63 void set_current_native_scrolling_node( | 70 void set_current_native_scrolling_node( |
64 ScrollNode* current_native_scrolling_node); | 71 ScrollNode* current_native_scrolling_node); |
65 ElementId current_native_scrolling_element() const; | 72 ElementId current_native_scrolling_element() const; |
66 void set_current_native_scrolling_element(ElementId element_id); | 73 void set_current_native_scrolling_element(ElementId element_id); |
67 | 74 |
68 private: | 75 private: |
69 // Only one of current_native_scrolling_node_ and | 76 // Only one of current_native_scrolling_node_ and |
70 // current_native_scrolling_element_ may be non-null at a time. Whenever | 77 // current_native_scrolling_element_ may be non-null at a time. Whenever |
71 // possible, we should store the scroll node. | 78 // possible, we should store the scroll node. |
72 | 79 |
73 // The last scroll node to respond to a scroll, or null if none exists. | 80 // The last scroll node to respond to a scroll, or null if none exists. |
74 ScrollNode* current_native_scrolling_node_; | 81 ScrollNode* current_native_scrolling_node_; |
75 // The id of the last native element to respond to a scroll, or 0 if none | 82 // The id of the last native element to respond to a scroll, or 0 if none |
76 // exists. | 83 // exists. |
77 ElementId current_native_scrolling_element_; | 84 ElementId current_native_scrolling_element_; |
78 }; | 85 }; |
79 | 86 |
80 } // namespace cc | 87 } // namespace cc |
81 | 88 |
82 #endif // CC_INPUT_SCROLL_STATE_DATA_H_ | 89 #endif // CC_INPUT_SCROLL_STATE_DATA_H_ |
OLD | NEW |