Index: cc/input/scroll_state_data.h |
diff --git a/cc/input/scroll_state_data.h b/cc/input/scroll_state_data.h |
index 302970bd08d7f898390e98aadfd920bfdc9b51b5..76089145cf2c6d9789c0ec7a7ddd01d93dc2f161 100644 |
--- a/cc/input/scroll_state_data.h |
+++ b/cc/input/scroll_state_data.h |
@@ -5,6 +5,8 @@ |
#ifndef CC_INPUT_SCROLL_STATE_DATA_H_ |
#define CC_INPUT_SCROLL_STATE_DATA_H_ |
+#include <stdint.h> |
+ |
#include <list> |
#include "cc/base/cc_export.h" |
@@ -13,21 +15,10 @@ namespace cc { |
class LayerImpl; |
-struct CC_EXPORT ScrollStateData { |
+class CC_EXPORT ScrollStateData { |
public: |
ScrollStateData(); |
- ScrollStateData(double delta_x, |
- double delta_y, |
- int start_position_x, |
- int start_position_y, |
- double velocity_x, |
- double velocity_y, |
- bool is_beginning, |
- bool is_in_inertial_phase, |
- bool is_ending, |
- bool should_propagate, |
- bool delta_consumed_for_scroll_sequence, |
- bool is_direct_manipulation); |
+ |
// Scroll delta in viewport coordinates (DIP). |
double delta_x; |
double delta_y; |
@@ -43,15 +34,17 @@ struct CC_EXPORT ScrollStateData { |
bool is_ending; |
bool should_propagate; |
+ bool from_user_input; |
- // The last layer to respond to a scroll, or null if none exists. |
- LayerImpl* current_native_scrolling_layer; |
// Whether the scroll sequence has had any delta consumed, in the |
// current frame, or any child frames. |
bool delta_consumed_for_scroll_sequence; |
// True if the user interacts directly with the display, e.g., via |
// touch. |
bool is_direct_manipulation; |
+ // Minimum amount this input device can scroll. |
+ double delta_granularity; |
+ |
// TODO(tdresser): ScrollState shouldn't need to keep track of whether or not |
// this ScrollState object has caused a scroll. Ideally, any native scroller |
// consuming delta has caused a scroll. Currently, there are some cases where |
@@ -60,6 +53,23 @@ struct CC_EXPORT ScrollStateData { |
// of |caused_scroll_*_|. See crbug.com/510045 for details. |
bool caused_scroll_x; |
bool caused_scroll_y; |
+ |
+ LayerImpl* current_native_scrolling_layer() const; |
+ void set_current_native_scrolling_layer( |
+ LayerImpl* current_native_scrolling_layer); |
+ uint64_t current_native_scrolling_element() const; |
+ void set_current_native_scrolling_element(uint64_t element_id); |
+ |
+ private: |
+ // Only one of current_native_scrolling_layer_ and |
+ // current_native_scrolling_element_ may be non-null at a time. Whenever |
+ // possible, we should store the layer. |
+ |
+ // The last layer to respond to a scroll, or null if none exists. |
+ LayerImpl* current_native_scrolling_layer_; |
+ // The id of the last native element to respond to a scroll, or 0 if none |
+ // exists. |
+ uint64_t current_native_scrolling_element_; |
}; |
} // namespace cc |