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 #include "core/page/scrolling/ScrollState.h" | 5 #include "core/page/scrolling/ScrollState.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include "core/dom/DOMNodeIds.h" | 8 #include "core/dom/DOMNodeIds.h" |
9 #include "core/dom/Element.h" | 9 #include "core/dom/Element.h" |
10 #include "core/dom/ExceptionCode.h" | 10 #include "core/dom/ExceptionCode.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 return nullptr; | 25 return nullptr; |
26 return static_cast<Element*>(node); | 26 return static_cast<Element*>(node); |
27 } | 27 } |
28 } // namespace | 28 } // namespace |
29 | 29 |
30 ScrollState* ScrollState::Create(ScrollStateInit init) { | 30 ScrollState* ScrollState::Create(ScrollStateInit init) { |
31 std::unique_ptr<ScrollStateData> scroll_state_data = | 31 std::unique_ptr<ScrollStateData> scroll_state_data = |
32 WTF::MakeUnique<ScrollStateData>(); | 32 WTF::MakeUnique<ScrollStateData>(); |
33 scroll_state_data->delta_x = init.deltaX(); | 33 scroll_state_data->delta_x = init.deltaX(); |
34 scroll_state_data->delta_y = init.deltaY(); | 34 scroll_state_data->delta_y = init.deltaY(); |
| 35 scroll_state_data->delta_x_hint = init.deltaXHint(); |
| 36 scroll_state_data->delta_y_hint = init.deltaYHint(); |
35 scroll_state_data->position_x = init.positionX(); | 37 scroll_state_data->position_x = init.positionX(); |
36 scroll_state_data->position_y = init.positionY(); | 38 scroll_state_data->position_y = init.positionY(); |
37 scroll_state_data->velocity_x = init.velocityX(); | 39 scroll_state_data->velocity_x = init.velocityX(); |
38 scroll_state_data->velocity_y = init.velocityY(); | 40 scroll_state_data->velocity_y = init.velocityY(); |
39 scroll_state_data->is_beginning = init.isBeginning(); | 41 scroll_state_data->is_beginning = init.isBeginning(); |
40 scroll_state_data->is_in_inertial_phase = init.isInInertialPhase(); | 42 scroll_state_data->is_in_inertial_phase = init.isInInertialPhase(); |
41 scroll_state_data->is_ending = init.isEnding(); | 43 scroll_state_data->is_ending = init.isEnding(); |
42 scroll_state_data->should_propagate = init.shouldPropagate(); | 44 scroll_state_data->should_propagate = init.shouldPropagate(); |
43 scroll_state_data->from_user_input = init.fromUserInput(); | 45 scroll_state_data->from_user_input = init.fromUserInput(); |
44 scroll_state_data->is_direct_manipulation = init.isDirectManipulation(); | 46 scroll_state_data->is_direct_manipulation = init.isDirectManipulation(); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 } | 104 } |
103 | 105 |
104 void ScrollState::SetCurrentNativeScrollingElement(Element* element) { | 106 void ScrollState::SetCurrentNativeScrollingElement(Element* element) { |
105 element_ = element; | 107 element_ = element; |
106 data_->set_current_native_scrolling_element(CompositorElementIdFromDOMNodeId( | 108 data_->set_current_native_scrolling_element(CompositorElementIdFromDOMNodeId( |
107 DOMNodeIds::IdForNode(element), | 109 DOMNodeIds::IdForNode(element), |
108 CompositorElementIdNamespace::kScrollState)); | 110 CompositorElementIdNamespace::kScrollState)); |
109 } | 111 } |
110 | 112 |
111 } // namespace blink | 113 } // namespace blink |
OLD | NEW |