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 ScrollStateCallback_h | |
| 6 #define ScrollStateCallback_h | |
| 7 | |
| 8 #include "core/dom/Element.h" | |
| 9 #include "platform/heap/GarbageCollected.h" | |
| 10 | |
| 11 namespace blink { | |
| 12 | |
| 13 class ScrollState; | |
| 14 | |
| 15 class ScrollStateCallback : public RefCountedWillBeGarbageCollectedFinalized<Scr ollStateCallback> { | |
|
haraken
2015/06/27 08:09:33
I think we can just make Oilpan the default. WillB
tdresser
2015/06/29 20:59:33
Thanks, that definitely simplifies things.
| |
| 16 public: | |
| 17 enum class CallbackType { | |
| 18 UNSET, | |
| 19 APPLY_SCROLL, | |
| 20 DISTRIBUTE_SCROLL, | |
| 21 }; | |
| 22 ScrollStateCallback(); | |
| 23 virtual ~ScrollStateCallback() | |
| 24 { | |
| 25 } | |
| 26 DEFINE_INLINE_VIRTUAL_TRACE() {} | |
| 27 virtual void handleEvent(ScrollState*) = 0; | |
| 28 void handleEventForElement(Element& targetElement, ScrollState*); | |
| 29 ScriptValue toScriptValue(ScriptState*); | |
| 30 CallbackType callbackType() { return m_callbackType; } | |
| 31 void setCallbackType(CallbackType callbackType) { m_callbackType = callbackT ype; } | |
| 32 | |
| 33 protected: | |
| 34 // Used to pass the target element to handleEvent for native | |
| 35 // ScrollStateCallback implementations. Null except within the | |
| 36 // scope of |handleEventForElement|. | |
| 37 Element* m_targetElement; | |
|
haraken
2015/06/27 08:09:33
This is a strong reference, so shall we use Member
tdresser
2015/06/29 20:59:33
It can't be a Member<Element> in the non-oilpan ca
| |
| 38 CallbackType m_callbackType; | |
| 39 }; | |
| 40 | |
| 41 } // namespace blink | |
| 42 | |
| 43 #endif // ScrollStateCallback_h | |
| OLD | NEW |