| 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 #ifndef ScrollState_h | 5 #ifndef ScrollState_h |
| 6 #define ScrollState_h | 6 #define ScrollState_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
| 9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
| 10 #include "core/CoreExport.h" | 10 #include "core/CoreExport.h" |
| 11 #include "core/page/scrolling/ScrollStateInit.h" | 11 #include "core/page/scrolling/ScrollStateInit.h" |
| 12 #include "platform/scroll/ScrollStateData.h" | 12 #include "platform/scroll/ScrollStateData.h" |
| 13 #include "wtf/Forward.h" | 13 #include "wtf/Forward.h" |
| 14 #include <deque> | 14 #include <deque> |
| 15 #include <memory> | |
| 16 | 15 |
| 17 namespace blink { | 16 namespace blink { |
| 18 | 17 |
| 19 class Element; | 18 class Element; |
| 20 | 19 |
| 21 class CORE_EXPORT ScrollState final : public GarbageCollectedFinalized<ScrollSta
te>, public ScriptWrappable { | 20 class CORE_EXPORT ScrollState final : public GarbageCollectedFinalized<ScrollSta
te>, public ScriptWrappable { |
| 22 DEFINE_WRAPPERTYPEINFO(); | 21 DEFINE_WRAPPERTYPEINFO(); |
| 23 | 22 |
| 24 public: | 23 public: |
| 25 static ScrollState* create(ScrollStateInit); | 24 static ScrollState* create(ScrollStateInit); |
| 26 static ScrollState* create(std::unique_ptr<ScrollStateData>); | 25 static ScrollState* create(PassOwnPtr<ScrollStateData>); |
| 27 | 26 |
| 28 ~ScrollState() | 27 ~ScrollState() |
| 29 { | 28 { |
| 30 } | 29 } |
| 31 | 30 |
| 32 // Web exposed methods. | 31 // Web exposed methods. |
| 33 | 32 |
| 34 // Reduce deltas by x, y. | 33 // Reduce deltas by x, y. |
| 35 void consumeDelta(double x, double y, ExceptionState&); | 34 void consumeDelta(double x, double y, ExceptionState&); |
| 36 // Pops the first element off of |m_scrollChain| and calls |distributeScroll
| on it. | 35 // Pops the first element off of |m_scrollChain| and calls |distributeScroll
| on it. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 { | 85 { |
| 87 return !m_data->delta_x && !m_data->delta_y && !m_data->is_ending && !m_
data->is_beginning; | 86 return !m_data->delta_x && !m_data->delta_y && !m_data->is_ending && !m_
data->is_beginning; |
| 88 } | 87 } |
| 89 | 88 |
| 90 ScrollStateData* data() const { return m_data.get(); } | 89 ScrollStateData* data() const { return m_data.get(); } |
| 91 | 90 |
| 92 DEFINE_INLINE_TRACE() {} | 91 DEFINE_INLINE_TRACE() {} |
| 93 | 92 |
| 94 private: | 93 private: |
| 95 ScrollState(); | 94 ScrollState(); |
| 96 explicit ScrollState(std::unique_ptr<ScrollStateData>); | 95 explicit ScrollState(PassOwnPtr<ScrollStateData>); |
| 97 | 96 |
| 98 std::unique_ptr<ScrollStateData> m_data; | 97 OwnPtr<ScrollStateData> m_data; |
| 99 std::deque<int> m_scrollChain; | 98 std::deque<int> m_scrollChain; |
| 100 }; | 99 }; |
| 101 | 100 |
| 102 } // namespace blink | 101 } // namespace blink |
| 103 | 102 |
| 104 #endif // ScrollState_h | 103 #endif // ScrollState_h |
| OLD | NEW |