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

Unified Diff: android_webview/browser/browser_view_renderer.h

Issue 274323004: NOT FOR LANDING - [WebView] Allow fling animation via the LayerScrollOffsetDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 5 years, 10 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 | « no previous file | android_webview/browser/browser_view_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/browser_view_renderer.h
diff --git a/android_webview/browser/browser_view_renderer.h b/android_webview/browser/browser_view_renderer.h
index ee6aa29914b2c8fdca6fada0ab33a5f3bf0516b6..bb5c9c7cf81462ffd143814ddb0fc8c56ff1ec0a 100644
--- a/android_webview/browser/browser_view_renderer.h
+++ b/android_webview/browser/browser_view_renderer.h
@@ -72,6 +72,7 @@ class BrowserViewRenderer : public content::SynchronousCompositorClient {
void OnSizeChanged(int width, int height);
void OnAttachedToWindow(int width, int height);
void OnDetachedFromWindow();
+ void OnComputeScroll(base::TimeTicks animation_time);
// Sets the scale for logical<->physical pixel conversions.
void SetDipScale(float dip_scale);
@@ -104,6 +105,7 @@ class BrowserViewRenderer : public content::SynchronousCompositorClient {
float min_page_scale_factor,
float max_page_scale_factor) override;
bool IsExternalFlingActive() const override;
+ void SetNeedsAnimateFling(const AnimationCallback& fling_animation) override;
void DidOverscroll(gfx::Vector2dF accumulated_overscroll,
gfx::Vector2dF latest_overscroll_delta,
gfx::Vector2dF current_fling_velocity) override;
@@ -145,6 +147,10 @@ class BrowserViewRenderer : public content::SynchronousCompositorClient {
// compositor that are not directly exposed here.
void ForceFakeCompositeSW();
+ // Honor the requested fling animation as contained in
+ // |pending_fling_animation_|.
+ void FlushPendingFlingAnimation(base::TimeTicks animation_time);
+
gfx::Vector2d max_scroll_offset() const;
size_t CalculateDesiredMemoryPolicy();
@@ -194,6 +200,11 @@ class BrowserViewRenderer : public content::SynchronousCompositorClient {
gfx::Size size_;
+ // Used to drive a fling animation as requested by the compositor. This acts
+ // as a single-shot animation; the compositor will continually post an
+ // animation callback as long as they're required.
+ AnimationCallback pending_fling_animation_;
+
// Current scroll offset in CSS pixels.
gfx::Vector2dF scroll_offset_dip_;
« no previous file with comments | « no previous file | android_webview/browser/browser_view_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698