Chromium Code Reviews| 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 void removeAllCallbacksForDocument(Document*); | |
|
haraken
2015/08/27 00:49:40
Can we remove this?
tdresser
2015/08/27 20:48:40
Done.
| |
| 35 | |
| 36 #if !ENABLE(OILPAN) | |
| 37 void removeCallbacksForElement(Element*); | |
| 38 #endif | |
| 39 | |
| 40 private: | |
| 41 using ScrollStateCallbackList = HeapHashMap<RawPtrWillBeWeakMember<Element>, WeakMember<ScrollStateCallback>>; | |
| 42 ScrollStateCallbackList m_applyScrollCallbacks; | |
| 43 ScrollStateCallbackList m_distributeScrollCallbacks; | |
| 44 }; | |
| 45 | |
| 46 } // namespace blink | |
| 47 | |
| 48 #endif // ScrollCustomizationCallbacks_h | |
| OLD | NEW |