Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(899)

Side by Side Diff: Source/core/page/scrolling/ScrollStateCallback.h

Issue 1057603002: Expose scroll customization for touch to JS (behind REF). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address haraken's comments. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 "bindings/core/v8/ScrollStateCallbackToScriptValue.h"
9 #include "core/dom/Element.h"
10 #include "platform/heap/GarbageCollected.h"
11
12 namespace blink {
13
14 class ScrollState;
15
16 class ScrollStateCallback : public GarbageCollectedFinalized<ScrollStateCallback > {
17 public:
18 enum class CallbackType {
19 UNSET,
20 APPLY_SCROLL,
21 DISTRIBUTE_SCROLL,
22 };
23 ScrollStateCallback();
24 virtual ~ScrollStateCallback() {}
25 DEFINE_INLINE_VIRTUAL_TRACE() { visitor->trace(m_targetElement); }
26 virtual void handleEvent(ScrollState*) = 0;
27 void handleEventForElement(Element& targetElement, ScrollState*);
28 ScriptValue toScriptValue(ScriptState* scriptState) { return scrollStateCall backToScriptValue(*this, scriptState); }
29 CallbackType callbackType() { return m_callbackType; }
30 void setCallbackType(CallbackType callbackType) { m_callbackType = callbackT ype; }
31
32 protected:
33 // Used to pass the target element to handleEvent for native
34 // ScrollStateCallback implementations. Null except within the
35 // scope of |handleEventForElement|.
36 RefPtrWillBeMember<Element> m_targetElement;
37 CallbackType m_callbackType;
38 };
39
40 } // namespace blink
41
42 #endif // ScrollStateCallback_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698