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

Unified Diff: Source/core/page/scrolling/ScrollStateCallback.cpp

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/ScrollStateCallback.cpp
diff --git a/Source/core/page/scrolling/ScrollStateCallback.cpp b/Source/core/page/scrolling/ScrollStateCallback.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..c1756f5908ed99d934c94bd42d0b24ff17ffd578
--- /dev/null
+++ b/Source/core/page/scrolling/ScrollStateCallback.cpp
@@ -0,0 +1,27 @@
+// 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.
+
+#include "config.h"
+#include "core/page/scrolling/ScrollStateCallback.h"
+
+namespace blink {
+
+NativeScrollBehavior ScrollStateCallback::toNativeScrollBehavior(String nativeScrollBehavior)
+{
+ DEFINE_STATIC_LOCAL(const String, disable, ("disable-native-scroll"));
+ DEFINE_STATIC_LOCAL(const String, before, ("perform-before-native-scroll"));
+ DEFINE_STATIC_LOCAL(const String, after, ("perform-after-native-scroll"));
+
+ if (nativeScrollBehavior == disable)
+ return NativeScrollBehavior::DisableNativeScroll;
+ if (nativeScrollBehavior == before)
+ return NativeScrollBehavior::PerformBeforeNativeScroll;
+ if (nativeScrollBehavior == after)
+ return NativeScrollBehavior::PerformAfterNativeScroll;
+
+ ASSERT_NOT_REACHED();
+ return NativeScrollBehavior::DisableNativeScroll;
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698