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

Unified Diff: third_party/WebKit/Source/core/page/scrolling/ChildViewportScrollCallback.cpp

Issue 2128543002: Make ViewportScrollCallback an interface and add child and root classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@moveViewportCreationToDocumentAttachment
Patch Set: Rebase Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/page/scrolling/ChildViewportScrollCallback.cpp
diff --git a/third_party/WebKit/Source/core/page/scrolling/ChildViewportScrollCallback.cpp b/third_party/WebKit/Source/core/page/scrolling/ChildViewportScrollCallback.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..3ac8d9f1c8f410df7cefe9bed257df559126e1cb
--- /dev/null
+++ b/third_party/WebKit/Source/core/page/scrolling/ChildViewportScrollCallback.cpp
@@ -0,0 +1,44 @@
+// Copyright 2016 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.
+
+#include "core/page/scrolling/ChildViewportScrollCallback.h"
+
+#include "core/page/scrolling/ScrollState.h"
+#include "platform/geometry/FloatSize.h"
+#include "platform/scroll/ScrollTypes.h"
+#include "platform/scroll/ScrollableArea.h"
+
+namespace blink {
+
+ChildViewportScrollCallback::ChildViewportScrollCallback()
+{
+}
+
+ChildViewportScrollCallback::~ChildViewportScrollCallback()
+{
+}
+
+DEFINE_TRACE(ChildViewportScrollCallback)
+{
+ visitor->trace(m_scroller);
+ ViewportScrollCallback::trace(visitor);
+}
+
+
+void ChildViewportScrollCallback::handleEvent(ScrollState* state)
+{
+ DCHECK(state);
+
+ if (!m_scroller)
+ return;
+
+ performNativeScroll(*state, *m_scroller);
+}
+
+void ChildViewportScrollCallback::setScroller(ScrollableArea* scroller)
+{
+ m_scroller = scroller;
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698