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

Unified Diff: Source/core/page/scrolling/ScrollCustomizationCallbacks.h

Issue 1236913004: Expose scroll customization for touch to JS (behind REF). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Change map value to WeakMember, remove Document hack. Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/page/scrolling/ScrollCustomizationCallbacks.h
diff --git a/Source/core/page/scrolling/ScrollCustomizationCallbacks.h b/Source/core/page/scrolling/ScrollCustomizationCallbacks.h
new file mode 100644
index 0000000000000000000000000000000000000000..a81eb2deed6bf50ea999f152b0f2e18084646789
--- /dev/null
+++ b/Source/core/page/scrolling/ScrollCustomizationCallbacks.h
@@ -0,0 +1,48 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ScrollCustomizationCallbacks_h
+#define ScrollCustomizationCallbacks_h
+
+#include "core/CoreExport.h"
+#include "core/dom/Element.h"
+#include "platform/heap/Handle.h"
+#include "wtf/HashMap.h"
+
+namespace blink {
+
+class Document;
+class ScrollStateCallback;
+
+class CORE_EXPORT ScrollCustomizationCallbacks : public GarbageCollected<ScrollCustomizationCallbacks> {
+ WTF_MAKE_NONCOPYABLE(ScrollCustomizationCallbacks);
+
+public:
+ ScrollCustomizationCallbacks() {}
+ void setDistributeScroll(Element*, ScrollStateCallback*);
+ ScrollStateCallback* getDistributeScroll(Element*);
+ void setApplyScroll(Element*, ScrollStateCallback*);
+ ScrollStateCallback* getApplyScroll(Element*);
+
+ DEFINE_INLINE_TRACE()
+ {
+ visitor->trace(m_applyScrollCallbacks);
+ visitor->trace(m_distributeScrollCallbacks);
+ };
+
+ void removeAllCallbacksForDocument(Document*);
haraken 2015/08/27 00:49:40 Can we remove this?
tdresser 2015/08/27 20:48:40 Done.
+
+#if !ENABLE(OILPAN)
+ void removeCallbacksForElement(Element*);
+#endif
+
+private:
+ using ScrollStateCallbackList = HeapHashMap<RawPtrWillBeWeakMember<Element>, WeakMember<ScrollStateCallback>>;
+ ScrollStateCallbackList m_applyScrollCallbacks;
+ ScrollStateCallbackList m_distributeScrollCallbacks;
+};
+
+} // namespace blink
+
+#endif // ScrollCustomizationCallbacks_h

Powered by Google App Engine
This is Rietveld 408576698