Content settings: remove some plugin-related code/resources when... there are no...
[chromium-blink-merge.git] / cc / input / scroll_state.cc
blob52a0cca694325a1ef1eb85e4bd4fa75e4f38f776
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"
9 namespace cc {
11 ScrollState::ScrollState(double delta_x,
12 double delta_y,
13 int start_position_x,
14 int start_position_y,
15 bool should_propagate,
16 bool delta_consumed_for_scroll_sequence,
17 bool is_direct_manipulation)
18 : delta_x_(delta_x),
19 delta_y_(delta_y),
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) {
31 delta_x_ -= x;
32 delta_y_ -= y;
34 if (x || 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);
46 } // namespace cc