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

Issue 1063853005: Unify Android Webview and Chrome's fling (Closed)

Created:
5 years, 8 months ago by hush (inactive)
Modified:
5 years, 6 months ago
CC:
android-webview-reviews_chromium.org, cc-bugs_chromium.org, chromium-reviews, darin-cc_chromium.org, jam, jdduke+watch_chromium.org, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, bokan
Base URL:
https://chromium.googlesource.com/a/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Unify Android Webview and Chrome's fling There are two ways to generate flings in Android WebView: through user finger gesture or through calling WebView API flingScroll(int vx, int vy). This CL unifies Android WebView's fling code with Chrome. This means Android WebView will use the same fling curve in InputHandlerProxy as Chrome now does. Also note "smooth scrolling" (which is used by WebView#pageUp(), WebView#pageDown() and WebView#requestChildRectangleOnScreen(child, rect, false)) logic stays unchanged in this CL and does not use the same fling curve as mentioned above. Instead, it uses the underlying curve in android.widget.OverScroller.startScroll(). Corner cases: 1. What happens when a smooth scroll immediately follows a fling before the fling finishes? The fling will be stopped and smooth scroll takes control of WebView's scroll offset. 2. What happens when a fling immediately follows a smooth scroll before it finishes? The smooth scroll will be stopped and fling takes control of WebView's scroll offset. Next steps: 1. crbug.com/493765: make the API WebView#flingScroll() always target root layer. 2. Smooth scroll is still handled by WebView. Expose ui::Scroller::StartScroll to support smooth scroll in chromium compositor. BUG=378984 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Committed: https://crrev.com/b0ee8dc431d6d871f4001c9eb924d33a33d9e874 Cr-Commit-Position: refs/heads/master@{#333626}

Patch Set 1 #

Patch Set 2 : rebase #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : for review #

Total comments: 8

Patch Set 7 : comments #

Total comments: 13

Patch Set 8 : rebase #

Patch Set 9 : comments #

Patch Set 10 : #

Patch Set 11 : comments #

Patch Set 12 : #

Patch Set 13 : fix test #

Patch Set 14 : #

Total comments: 8

Patch Set 15 : Jared's comments #

Total comments: 4

Patch Set 16 : rebase #

Patch Set 17 : add a todo #

Total comments: 20

Patch Set 18 : address Bo's comment #

Patch Set 19 : rebase #

Total comments: 12

Patch Set 20 : Bo's Comments #

Patch Set 21 : #

Patch Set 22 : add proguard #

Unified diffs Side-by-side diffs Delta from patch set Stats (+333 lines, -199 lines) Patch
M android_webview/browser/browser_view_renderer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +9 lines, -1 line 0 comments Download
M android_webview/browser/browser_view_renderer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 4 chunks +25 lines, -3 lines 0 comments Download
M android_webview/browser/browser_view_renderer_client.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -2 lines 0 comments Download
M android_webview/browser/test/rendering_test.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -2 lines 0 comments Download
M android_webview/browser/test/rendering_test.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M android_webview/java/src/org/chromium/android_webview/AwContentViewClient.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +2 lines, -2 lines 0 comments Download
M android_webview/java/src/org/chromium/android_webview/AwContents.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 9 chunks +43 lines, -16 lines 0 comments Download
M android_webview/java/src/org/chromium/android_webview/AwScrollOffsetManager.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 5 chunks +12 lines, -33 lines 0 comments Download
M android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +1 line, -13 lines 0 comments Download
M android_webview/javatests/src/org/chromium/android_webview/test/AwScrollOffsetManagerTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +4 lines, -18 lines 0 comments Download
M android_webview/native/aw_contents.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +5 lines, -2 lines 0 comments Download
M android_webview/native/aw_contents.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +16 lines, -5 lines 0 comments Download
M cc/input/input_handler.h View 1 chunk +1 line, -1 line 0 comments Download
M cc/input/layer_scroll_offset_delegate.h View 1 2 3 4 5 6 7 8 2 chunks +10 lines, -1 line 0 comments Download
M cc/layers/layer_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/layer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +2 lines, -2 lines 0 comments Download
M cc/trees/layer_tree_host_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +5 lines, -1 line 0 comments Download
M cc/trees/layer_tree_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 5 chunks +29 lines, -11 lines 0 comments Download
M cc/trees/layer_tree_host_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +15 lines, -2 lines 0 comments Download
M cc/trees/layer_tree_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -1 line 0 comments Download
M cc/trees/layer_tree_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/android/java_staging/proguard.flags View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/TabsTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -1 line 0 comments Download
M content/browser/android/in_process/synchronous_compositor_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/android/in_process/synchronous_compositor_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +11 lines, -2 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/ContentViewClient.java View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +3 lines, -9 lines 0 comments Download
M content/public/android/java/src/org/chromium/content_public/browser/GestureStateListener.java View 1 2 3 4 5 6 1 chunk +0 lines, -5 lines 0 comments Download
M content/public/android/javatests/src/org/chromium/content/browser/ContentViewReadbackTest.java View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M content/public/android/javatests/src/org/chromium/content/browser/ContentViewScrollingTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M content/public/browser/android/synchronous_compositor_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +6 lines, -1 line 0 comments Download
M content/renderer/input/input_handler_proxy.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +6 lines, -4 lines 0 comments Download
M content/renderer/input/input_handler_proxy_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 47 chunks +106 lines, -53 lines 0 comments Download

Messages

Total messages: 55 (10 generated)
hush (inactive)
Hi Jared, PTAL PS6! The tests are passing.. I haven't added a unit test in ...
5 years, 7 months ago (2015-05-04 21:05:38 UTC) #2
jdduke (slow)
Thanks for tackling this. https://codereview.chromium.org/1063853005/diff/100001/android_webview/java/src/org/chromium/android_webview/AwContents.java File android_webview/java/src/org/chromium/android_webview/AwContents.java (right): https://codereview.chromium.org/1063853005/diff/100001/android_webview/java/src/org/chromium/android_webview/AwContents.java#newcode580 android_webview/java/src/org/chromium/android_webview/AwContents.java:580: public void onUnhandledFlingStartEvent(int velocityX, int ...
5 years, 7 months ago (2015-05-04 22:02:10 UTC) #3
jdduke (slow)
https://codereview.chromium.org/1063853005/diff/100001/android_webview/java/src/org/chromium/android_webview/AwContents.java File android_webview/java/src/org/chromium/android_webview/AwContents.java (right): https://codereview.chromium.org/1063853005/diff/100001/android_webview/java/src/org/chromium/android_webview/AwContents.java#newcode2525 android_webview/java/src/org/chromium/android_webview/AwContents.java:2525: // TODO(jdduke): Skip this for components with non-zero velocity? ...
5 years, 7 months ago (2015-05-04 22:11:48 UTC) #4
hush (inactive)
https://codereview.chromium.org/1063853005/diff/100001/android_webview/java/src/org/chromium/android_webview/AwContents.java File android_webview/java/src/org/chromium/android_webview/AwContents.java (right): https://codereview.chromium.org/1063853005/diff/100001/android_webview/java/src/org/chromium/android_webview/AwContents.java#newcode580 android_webview/java/src/org/chromium/android_webview/AwContents.java:580: public void onUnhandledFlingStartEvent(int velocityX, int velocityY) { On 2015/05/04 ...
5 years, 7 months ago (2015-05-05 21:15:32 UTC) #5
jdduke (slow)
+aelias for thoughts on the design (one that mkosiba and I toyed with a long ...
5 years, 7 months ago (2015-05-05 21:38:02 UTC) #7
aelias_OOO_until_Jul13
Could you remind me why CC's self-scheduling can't be used for them?
5 years, 7 months ago (2015-05-06 00:25:00 UTC) #8
jdduke (slow)
On 2015/05/06 00:25:00, aelias wrote: > Could you remind me why CC's self-scheduling can't be ...
5 years, 7 months ago (2015-05-06 01:28:45 UTC) #9
jdduke (slow)
+cc boliu who might know more about how fling timing should behave.
5 years, 7 months ago (2015-05-06 01:30:04 UTC) #10
boliu
On 2015/05/06 01:30:04, jdduke wrote: > +cc boliu who might know more about how fling ...
5 years, 7 months ago (2015-05-06 02:22:14 UTC) #11
jdduke (slow)
On 2015/05/06 02:22:14, boliu wrote: > On 2015/05/06 01:30:04, jdduke wrote: > > +cc boliu ...
5 years, 7 months ago (2015-05-06 18:25:22 UTC) #12
hush (inactive)
On 2015/05/06 18:25:22, jdduke wrote: > On 2015/05/06 02:22:14, boliu wrote: > > On 2015/05/06 ...
5 years, 7 months ago (2015-05-08 17:52:40 UTC) #13
boliu
On 2015/05/08 17:52:40, hush wrote: > On 2015/05/06 18:25:22, jdduke wrote: > > On 2015/05/06 ...
5 years, 7 months ago (2015-05-08 22:32:27 UTC) #14
hush (inactive)
On 2015/05/08 22:32:27, boliu wrote: > On 2015/05/08 17:52:40, hush wrote: > > On 2015/05/06 ...
5 years, 7 months ago (2015-05-09 00:19:49 UTC) #15
boliu
On 2015/05/09 00:19:49, hush wrote: > Scrolloffsets will be synced onDraw. > https://code.google.com/p/chromium/codesearch#chromium/src/android_webview/java/src/org/chromium/android_webview/AwContents.java&l=2662 > So ...
5 years, 7 months ago (2015-05-09 01:25:59 UTC) #16
aelias_OOO_until_Jul13
https://codereview.chromium.org/1063853005/diff/120001/android_webview/browser/browser_view_renderer.cc File android_webview/browser/browser_view_renderer.cc (right): https://codereview.chromium.org/1063853005/diff/120001/android_webview/browser/browser_view_renderer.cc#newcode616 android_webview/browser/browser_view_renderer.cc:616: // TODO(jdduke): Skip invalidate if animation already pending? Resolve ...
5 years, 7 months ago (2015-05-09 03:32:05 UTC) #17
hush (inactive)
https://codereview.chromium.org/1063853005/diff/120001/android_webview/browser/browser_view_renderer.cc File android_webview/browser/browser_view_renderer.cc (right): https://codereview.chromium.org/1063853005/diff/120001/android_webview/browser/browser_view_renderer.cc#newcode616 android_webview/browser/browser_view_renderer.cc:616: // TODO(jdduke): Skip invalidate if animation already pending? On ...
5 years, 7 months ago (2015-05-12 19:08:46 UTC) #18
jdduke (slow)
https://codereview.chromium.org/1063853005/diff/120001/android_webview/java/src/org/chromium/android_webview/AwContents.java File android_webview/java/src/org/chromium/android_webview/AwContents.java (right): https://codereview.chromium.org/1063853005/diff/120001/android_webview/java/src/org/chromium/android_webview/AwContents.java#newcode2520 android_webview/java/src/org/chromium/android_webview/AwContents.java:2520: if ((velocityX != 0 && firstOverscrollX) || (velocityY != ...
5 years, 7 months ago (2015-05-12 19:34:11 UTC) #19
jdduke (slow)
https://codereview.chromium.org/1063853005/diff/120001/android_webview/java/src/org/chromium/android_webview/AwContents.java File android_webview/java/src/org/chromium/android_webview/AwContents.java (right): https://codereview.chromium.org/1063853005/diff/120001/android_webview/java/src/org/chromium/android_webview/AwContents.java#newcode2519 android_webview/java/src/org/chromium/android_webview/AwContents.java:2519: // TODO(jdduke): Skip this for components with non-zero velocity? ...
5 years, 7 months ago (2015-05-12 20:46:07 UTC) #20
hush (inactive)
https://codereview.chromium.org/1063853005/diff/120001/android_webview/java/src/org/chromium/android_webview/AwContents.java File android_webview/java/src/org/chromium/android_webview/AwContents.java (right): https://codereview.chromium.org/1063853005/diff/120001/android_webview/java/src/org/chromium/android_webview/AwContents.java#newcode2519 android_webview/java/src/org/chromium/android_webview/AwContents.java:2519: // TODO(jdduke): Skip this for components with non-zero velocity? ...
5 years, 7 months ago (2015-05-13 23:26:20 UTC) #23
hush (inactive)
Hello Alex and Jared, PTAL patch set 11
5 years, 7 months ago (2015-05-13 23:27:11 UTC) #24
hush (inactive)
Hi Alex, any comments on this CL before you go on a vacation?
5 years, 7 months ago (2015-05-15 20:52:52 UTC) #25
aelias_OOO_until_Jul13
lgtm, please wait for jdduke's review as well though.
5 years, 7 months ago (2015-05-16 10:09:46 UTC) #26
jdduke (slow)
content/ basically lgtm, just a couple questions and a small test request. My final question ...
5 years, 7 months ago (2015-05-18 21:18:34 UTC) #27
hush (inactive)
https://codereview.chromium.org/1063853005/diff/300001/android_webview/browser/browser_view_renderer.h File android_webview/browser/browser_view_renderer.h (right): https://codereview.chromium.org/1063853005/diff/300001/android_webview/browser/browser_view_renderer.h#newcode111 android_webview/browser/browser_view_renderer.h:111: void SetNeedsAnimateFling(const AnimationCallback& fling_animation) override; On 2015/05/18 21:18:34, jdduke ...
5 years, 7 months ago (2015-05-19 18:14:59 UTC) #29
hush (inactive)
>> My final question is with respect to the GestureFlingStart hit test. In theory, the ...
5 years, 7 months ago (2015-05-19 18:18:37 UTC) #30
jdduke (slow)
On 2015/05/19 18:18:37, hush wrote: > >> My final question is with respect to the ...
5 years, 7 months ago (2015-05-19 18:45:00 UTC) #31
hush (inactive)
https://codereview.chromium.org/1063853005/diff/340001/android_webview/java/src/org/chromium/android_webview/AwContents.java File android_webview/java/src/org/chromium/android_webview/AwContents.java (right): https://codereview.chromium.org/1063853005/diff/340001/android_webview/java/src/org/chromium/android_webview/AwContents.java#newcode1882 android_webview/java/src/org/chromium/android_webview/AwContents.java:1882: mContentViewCore.fling(SystemClock.uptimeMillis(), 0, 0, -velocityX, -velocityY); Regarding the possibility of ...
5 years, 7 months ago (2015-05-27 23:11:38 UTC) #32
jdduke (slow)
+bokan for any thoughts on naming for a bit on GestureScrollBegin that would make it ...
5 years, 6 months ago (2015-05-28 15:18:09 UTC) #33
hush (inactive)
https://codereview.chromium.org/1063853005/diff/340001/android_webview/java/src/org/chromium/android_webview/AwContents.java File android_webview/java/src/org/chromium/android_webview/AwContents.java (right): https://codereview.chromium.org/1063853005/diff/340001/android_webview/java/src/org/chromium/android_webview/AwContents.java#newcode1882 android_webview/java/src/org/chromium/android_webview/AwContents.java:1882: mContentViewCore.fling(SystemClock.uptimeMillis(), 0, 0, -velocityX, -velocityY); On 2015/05/28 15:18:08, jdduke ...
5 years, 6 months ago (2015-05-28 23:49:51 UTC) #34
hush (inactive)
On 2015/05/28 23:49:51, hush wrote: > https://codereview.chromium.org/1063853005/diff/340001/android_webview/java/src/org/chromium/android_webview/AwContents.java > File android_webview/java/src/org/chromium/android_webview/AwContents.java > (right): > > https://codereview.chromium.org/1063853005/diff/340001/android_webview/java/src/org/chromium/android_webview/AwContents.java#newcode1882 ...
5 years, 6 months ago (2015-05-29 00:12:18 UTC) #35
jdduke (slow)
On 2015/05/29 00:12:18, hush wrote: > On 2015/05/28 23:49:51, hush wrote: > > > https://codereview.chromium.org/1063853005/diff/340001/android_webview/java/src/org/chromium/android_webview/AwContents.java ...
5 years, 6 months ago (2015-05-29 00:52:15 UTC) #36
hush (inactive)
Hi Bo! PTAL android_webview
5 years, 6 months ago (2015-05-29 17:33:02 UTC) #38
bokan
https://codereview.chromium.org/1063853005/diff/340001/android_webview/java/src/org/chromium/android_webview/AwContents.java File android_webview/java/src/org/chromium/android_webview/AwContents.java (right): https://codereview.chromium.org/1063853005/diff/340001/android_webview/java/src/org/chromium/android_webview/AwContents.java#newcode1882 android_webview/java/src/org/chromium/android_webview/AwContents.java:1882: mContentViewCore.fling(SystemClock.uptimeMillis(), 0, 0, -velocityX, -velocityY); On 2015/05/28 23:49:51, hush ...
5 years, 6 months ago (2015-05-29 19:32:49 UTC) #40
boliu
https://codereview.chromium.org/1063853005/diff/380001/android_webview/browser/browser_view_renderer.cc File android_webview/browser/browser_view_renderer.cc (right): https://codereview.chromium.org/1063853005/diff/380001/android_webview/browser/browser_view_renderer.cc#newcode617 android_webview/browser/browser_view_renderer.cc:617: client_->PostInvalidate(); Conceptually this feels wrong. What does "SetNeedAnimate" have ...
5 years, 6 months ago (2015-05-29 19:42:47 UTC) #41
hush (inactive)
https://codereview.chromium.org/1063853005/diff/380001/android_webview/browser/browser_view_renderer.cc File android_webview/browser/browser_view_renderer.cc (right): https://codereview.chromium.org/1063853005/diff/380001/android_webview/browser/browser_view_renderer.cc#newcode617 android_webview/browser/browser_view_renderer.cc:617: client_->PostInvalidate(); > Conceptually this feels wrong. What does "SetNeedAnimate" ...
5 years, 6 months ago (2015-06-05 21:47:22 UTC) #42
boliu
https://codereview.chromium.org/1063853005/diff/420001/android_webview/browser/browser_view_renderer.cc File android_webview/browser/browser_view_renderer.cc (right): https://codereview.chromium.org/1063853005/diff/420001/android_webview/browser/browser_view_renderer.cc#newcode421 android_webview/browser/browser_view_renderer.cc:421: "BrowserViewRenderer::FlushPendingScrollAnimation"); Fix trace event name https://codereview.chromium.org/1063853005/diff/420001/android_webview/browser/browser_view_renderer.cc#newcode623 android_webview/browser/browser_view_renderer.cc:623: PostInvalidateWithFallback(); Actually ...
5 years, 6 months ago (2015-06-08 16:54:52 UTC) #43
hush (inactive)
Try succeeded. PTAL! https://codereview.chromium.org/1063853005/diff/420001/android_webview/browser/browser_view_renderer.cc File android_webview/browser/browser_view_renderer.cc (right): https://codereview.chromium.org/1063853005/diff/420001/android_webview/browser/browser_view_renderer.cc#newcode421 android_webview/browser/browser_view_renderer.cc:421: "BrowserViewRenderer::FlushPendingScrollAnimation"); On 2015/06/08 16:54:52, boliu wrote: ...
5 years, 6 months ago (2015-06-09 19:11:34 UTC) #44
boliu
lgtm
5 years, 6 months ago (2015-06-09 19:15:43 UTC) #45
hush (inactive)
Hi Yaron, PTAL chrome/android/ and content/public
5 years, 6 months ago (2015-06-09 20:47:29 UTC) #47
hush (inactive)
On 2015/06/09 20:47:29, hush wrote: > Hi Yaron, > PTAL chrome/android/ and content/public These files ...
5 years, 6 months ago (2015-06-09 20:49:01 UTC) #48
Yaron
lgtm
5 years, 6 months ago (2015-06-09 21:24:29 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1063853005/480001
5 years, 6 months ago (2015-06-09 21:39:39 UTC) #52
commit-bot: I haz the power
Committed patchset #22 (id:480001)
5 years, 6 months ago (2015-06-10 00:49:06 UTC) #53
commit-bot: I haz the power
Patchset 22 (id:??) landed as https://crrev.com/b0ee8dc431d6d871f4001c9eb924d33a33d9e874 Cr-Commit-Position: refs/heads/master@{#333626}
5 years, 6 months ago (2015-06-10 00:51:00 UTC) #54
Torne
5 years, 6 months ago (2015-06-11 10:32:04 UTC) #55
Message was sent while issue was closed.
android.util.FloatMath was deprecated in L, we shouldn't be introducing calls to
it. I'll write a CL to replace this with Math.

Powered by Google App Engine
This is Rietveld 408576698