Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Side by Side Diff: third_party/WebKit/Source/core/page/scrolling/ScrollState.h

Issue 2881423004: Stop retrieving scrolling element id from the CompositorElementId. (Closed)
Patch Set: Merge branch 'master' into scrollstate Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/scrolling/ScrollState.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 ScrollState_h 5 #ifndef ScrollState_h
6 #define ScrollState_h 6 #define ScrollState_h
7 7
8 #include <deque> 8 #include <deque>
9 #include <memory> 9 #include <memory>
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
11 #include "core/CoreExport.h" 11 #include "core/CoreExport.h"
12 #include "core/dom/Element.h"
12 #include "core/page/scrolling/ScrollStateInit.h" 13 #include "core/page/scrolling/ScrollStateInit.h"
13 #include "platform/bindings/ScriptWrappable.h" 14 #include "platform/bindings/ScriptWrappable.h"
14 #include "platform/scroll/ScrollStateData.h" 15 #include "platform/scroll/ScrollStateData.h"
15 #include "platform/wtf/Forward.h" 16 #include "platform/wtf/Forward.h"
16 17
17 namespace blink { 18 namespace blink {
18 19
19 class Element; 20 class Element;
20 21
21 class CORE_EXPORT ScrollState final 22 class CORE_EXPORT ScrollState final
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 bool shouldPropagate() const { return data_->should_propagate; }; 65 bool shouldPropagate() const { return data_->should_propagate; };
65 66
66 // Non web exposed methods. 67 // Non web exposed methods.
67 void ConsumeDeltaNative(double x, double y); 68 void ConsumeDeltaNative(double x, double y);
68 69
69 // TODO(tdresser): this needs to be web exposed. See crbug.com/483091. 70 // TODO(tdresser): this needs to be web exposed. See crbug.com/483091.
70 void SetScrollChain(std::deque<int> scroll_chain) { 71 void SetScrollChain(std::deque<int> scroll_chain) {
71 scroll_chain_ = scroll_chain; 72 scroll_chain_ = scroll_chain;
72 } 73 }
73 74
74 Element* CurrentNativeScrollingElement() const; 75 Element* CurrentNativeScrollingElement();
75 void SetCurrentNativeScrollingElement(Element*); 76 void SetCurrentNativeScrollingElement(Element*);
76 77
77 void SetCurrentNativeScrollingElementById(int element_id);
78
79 bool DeltaConsumedForScrollSequence() const { 78 bool DeltaConsumedForScrollSequence() const {
80 return data_->delta_consumed_for_scroll_sequence; 79 return data_->delta_consumed_for_scroll_sequence;
81 } 80 }
82 81
83 // Scroll begin and end must propagate to all nodes to ensure 82 // Scroll begin and end must propagate to all nodes to ensure
84 // their state is updated. 83 // their state is updated.
85 bool FullyConsumed() const { 84 bool FullyConsumed() const {
86 return !data_->delta_x && !data_->delta_y && !data_->is_ending && 85 return !data_->delta_x && !data_->delta_y && !data_->is_ending &&
87 !data_->is_beginning; 86 !data_->is_beginning;
88 } 87 }
89 88
90 ScrollStateData* Data() const { return data_.get(); } 89 ScrollStateData* Data() const { return data_.get(); }
91 90
92 DEFINE_INLINE_TRACE() {} 91 DEFINE_INLINE_TRACE() { visitor->Trace(element_); }
93 92
94 private: 93 private:
95 ScrollState(); 94 ScrollState();
96 explicit ScrollState(std::unique_ptr<ScrollStateData>); 95 explicit ScrollState(std::unique_ptr<ScrollStateData>);
97 96
98 std::unique_ptr<ScrollStateData> data_; 97 std::unique_ptr<ScrollStateData> data_;
99 std::deque<int> scroll_chain_; 98 std::deque<int> scroll_chain_;
99 Member<Element> element_;
100 }; 100 };
101 101
102 } // namespace blink 102 } // namespace blink
103 103
104 #endif // ScrollState_h 104 #endif // ScrollState_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/scrolling/ScrollState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698