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