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 ScrollCustomizationCallbacks_h | 5 #ifndef ScrollCustomizationCallbacks_h |
6 #define ScrollCustomizationCallbacks_h | 6 #define ScrollCustomizationCallbacks_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/dom/Element.h" | 9 #include "core/dom/Element.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
11 #include "wtf/HashMap.h" | 11 #include "wtf/HashMap.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 class ScrollStateCallback; | 15 class ScrollStateCallback; |
16 | 16 |
17 class CORE_EXPORT ScrollCustomizationCallbacks : public GarbageCollected<ScrollC
ustomizationCallbacks> { | 17 class CORE_EXPORT ScrollCustomizationCallbacks : public GarbageCollected<ScrollC
ustomizationCallbacks> { |
18 WTF_MAKE_NONCOPYABLE(ScrollCustomizationCallbacks); | 18 WTF_MAKE_NONCOPYABLE(ScrollCustomizationCallbacks); |
19 | 19 |
20 public: | 20 public: |
21 ScrollCustomizationCallbacks() {} | 21 ScrollCustomizationCallbacks() {} |
22 void setDistributeScroll(Element*, ScrollStateCallback*); | 22 void setDistributeScroll(Element*, ScrollStateCallback*); |
23 ScrollStateCallback* getDistributeScroll(Element*); | 23 ScrollStateCallback* getDistributeScroll(Element*); |
24 void setApplyScroll(Element*, ScrollStateCallback*); | 24 void setApplyScroll(Element*, ScrollStateCallback*); |
| 25 void removeApplyScroll(Element*); |
25 ScrollStateCallback* getApplyScroll(Element*); | 26 ScrollStateCallback* getApplyScroll(Element*); |
26 | 27 |
27 DEFINE_INLINE_TRACE() | 28 DEFINE_INLINE_TRACE() |
28 { | 29 { |
29 visitor->trace(m_applyScrollCallbacks); | 30 visitor->trace(m_applyScrollCallbacks); |
30 visitor->trace(m_distributeScrollCallbacks); | 31 visitor->trace(m_distributeScrollCallbacks); |
31 }; | 32 }; |
32 | 33 |
33 private: | 34 private: |
34 using ScrollStateCallbackList = HeapHashMap<WeakMember<Element>, Member<Scro
llStateCallback>>; | 35 using ScrollStateCallbackList = HeapHashMap<WeakMember<Element>, Member<Scro
llStateCallback>>; |
35 ScrollStateCallbackList m_applyScrollCallbacks; | 36 ScrollStateCallbackList m_applyScrollCallbacks; |
36 ScrollStateCallbackList m_distributeScrollCallbacks; | 37 ScrollStateCallbackList m_distributeScrollCallbacks; |
37 }; | 38 }; |
38 | 39 |
39 } // namespace blink | 40 } // namespace blink |
40 | 41 |
41 #endif // ScrollCustomizationCallbacks_h | 42 #endif // ScrollCustomizationCallbacks_h |
OLD | NEW |