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 #include "config.h" |
| 6 #include "core/page/scrolling/ScrollCustomizationCallbacks.h" |
| 7 |
| 8 #include "core/page/scrolling/ScrollStateCallback.h" |
| 9 #include "wtf/Deque.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 void ScrollCustomizationCallbacks::setDistributeScroll(Element* element, ScrollS
tateCallback* scrollStateCallback) |
| 14 { |
| 15 m_distributeScrollCallbacks.set(element, scrollStateCallback); |
| 16 } |
| 17 |
| 18 ScrollStateCallback* ScrollCustomizationCallbacks::getDistributeScroll(Element*
element) |
| 19 { |
| 20 auto it = m_distributeScrollCallbacks.find(element); |
| 21 if (it == m_distributeScrollCallbacks.end()) |
| 22 return nullptr; |
| 23 return it->value.get(); |
| 24 } |
| 25 |
| 26 void ScrollCustomizationCallbacks::setApplyScroll(Element* element, ScrollStateC
allback* scrollStateCallback) |
| 27 { |
| 28 m_applyScrollCallbacks.set(element, scrollStateCallback); |
| 29 } |
| 30 |
| 31 ScrollStateCallback* ScrollCustomizationCallbacks::getApplyScroll(Element* eleme
nt) |
| 32 { |
| 33 auto it = m_applyScrollCallbacks.find(element); |
| 34 if (it == m_applyScrollCallbacks.end()) |
| 35 return nullptr; |
| 36 return it->value.get(); |
| 37 } |
| 38 |
| 39 #if !ENABLE(OILPAN) |
| 40 void ScrollCustomizationCallbacks::removeCallbacksForElement(Element* element) |
| 41 { |
| 42 m_applyScrollCallbacks.remove(element); |
| 43 m_distributeScrollCallbacks.remove(element); |
| 44 } |
| 45 #endif |
| 46 |
| 47 } // namespace blink |
OLD | NEW |