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