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
3 // found in the LICENSE file.
5 #include "cc/input/scroll_state.h"
7 #include "cc/layers/layer_impl.h"
11 ScrollState::ScrollState(double delta_x
,
15 bool should_propagate
,
16 bool delta_consumed_for_scroll_sequence
,
17 bool is_direct_manipulation
)
20 start_position_x_(start_position_x
),
21 start_position_y_(start_position_y
),
22 should_propagate_(should_propagate
),
23 delta_consumed_for_scroll_sequence_(delta_consumed_for_scroll_sequence
),
24 is_direct_manipulation_(is_direct_manipulation
),
25 caused_scroll_x_(false),
26 caused_scroll_y_(false) {}
28 ScrollState::~ScrollState() {}
30 void ScrollState::ConsumeDelta(double x
, double y
) {
35 delta_consumed_for_scroll_sequence_
= true;
38 void ScrollState::DistributeToScrollChainDescendant() {
39 if (!scroll_chain_
.empty()) {
40 LayerImpl
* next
= scroll_chain_
.front();
41 scroll_chain_
.pop_front();
42 next
->DistributeScroll(this);