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