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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.h

Issue 14268004: Add overscroll edge effect animations for Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use LazyInstance for overscroll resources Created 7 years, 7 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: content/browser/renderer_host/render_widget_host_view_android.h
diff --git a/content/browser/renderer_host/render_widget_host_view_android.h b/content/browser/renderer_host/render_widget_host_view_android.h
index 8a50861266f4515e02637d3bd0800f0e8a3a114a..e76149c432c254f6c5c6ede1eda943b63ca124f6 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.h
+++ b/content/browser/renderer_host/render_widget_host_view_android.h
@@ -43,6 +43,7 @@ class WebMouseEvent;
namespace content {
class ContentViewCoreImpl;
+class OverscrollGlow;
class RenderWidgetHost;
class RenderWidgetHostImpl;
class SurfaceTextureTransportClient;
@@ -152,6 +153,8 @@ class RenderWidgetHostViewAndroid
virtual void HasTouchEventHandlers(bool need_touch_events) OVERRIDE;
virtual void OnSwapCompositorFrame(
scoped_ptr<cc::CompositorFrame> frame) OVERRIDE;
+ virtual void OnOverscrolled(gfx::Vector2dF accumulated_overscroll,
+ gfx::Vector2dF current_fling_velocity) OVERRIDE;
virtual void ShowDisambiguationPopup(const gfx::Rect& target_rect,
const SkBitmap& zoomed_bitmap) OVERRIDE;
virtual SmoothScrollGesture* CreateSmoothScrollGesture(
@@ -198,6 +201,10 @@ class RenderWidgetHostViewAndroid
void RequestContentClipping(const gfx::Rect& clipping,
const gfx::Size& content_size);
+ // Returns true when animation ticks are still needed. This avoids a separate
+ // round-trip for requesting follow-up animation.
+ bool Animate(base::TimeTicks frame_time);
+
private:
void BuffersSwapped(const gpu::Mailbox& mailbox,
const base::Closure& ack_callback);
@@ -211,6 +218,12 @@ class RenderWidgetHostViewAndroid
void ResetClipping();
void ClipContents(const gfx::Rect& clipping, const gfx::Size& content_size);
+ void AttachLayers();
+ void RemoveLayers();
+
+ void UpdateAnimationSize(const cc::CompositorFrame* frame);
+ void ScheduleAnimationIfNecessary();
+
// The model object.
RenderWidgetHostImpl* host_;
@@ -218,7 +231,7 @@ class RenderWidgetHostViewAndroid
// This view may not actually be attached if this is true, but it should be
// treated as such, because as soon as a ContentViewCore is set the layer
// will be attached automatically.
- bool is_layer_attached_;
+ bool are_layers_attached_;
// ContentViewCoreImpl is our interface to the view system.
ContentViewCoreImpl* content_view_core_;
@@ -260,6 +273,9 @@ class RenderWidgetHostViewAndroid
std::queue<base::Closure> ack_callbacks_;
+ // Used to render overscroll overlays.
+ scoped_ptr<OverscrollGlow> overscroll_effect_;
+
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid);
};
« no previous file with comments | « content/browser/android/overscroll_glow.cc ('k') | content/browser/renderer_host/render_widget_host_view_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698