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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 1251473003: Add WebView API for smoothScroll (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Provide default empty implementation on the api 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | public/web/WebView.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index bede818efbcccedd50386be4fa949b12950d608d..4ad025eea0104632a345d362dd70c03b2c3ec5f4 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -2874,6 +2874,17 @@ bool WebViewImpl::scrollFocusedNodeIntoRect(const WebRect& rectInViewport)
return false;
}
+void WebViewImpl::smoothScroll(int targetX, int targetY, long durationMs)
+{
+ LocalFrame* frame = page()->mainFrame() && page()->mainFrame()->isLocalFrame()
dcheng 2015/07/28 18:50:14 Who calls this? Will this be covered by a test on
aelias_OOO_until_Jul13 2015/07/28 19:00:21 Actually, why is this code here at all? The code
hush (inactive) 2015/07/28 19:18:11 I was copying the logic of WebViewImpl::scrollFocu
+ ? page()->deprecatedLocalMainFrame() : 0;
+ if (!frame || !frame->view())
+ return;
+
+ IntPoint targetPosition(targetX, targetY);
+ startPageScaleAnimation(targetPosition, false, pageScaleFactor(), (double)durationMs / 1000);
+}
+
void WebViewImpl::computeScaleAndScrollForFocusedNode(Node* focusedNode, bool zoomInToLegibleScale, float& newScale, IntPoint& newScroll, bool& needAnimation)
{
focusedNode->document().updateLayoutIgnorePendingStylesheets();
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | public/web/WebView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698