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

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: Cleanup and layer attachment fixes Created 7 years, 8 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 44bc78609531ad503d039ad8ef777e6710207135..b53d76d036d6e697da9ea78a08f9dda8045c1fb7 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.h
+++ b/content/browser/renderer_host/render_widget_host_view_android.h
@@ -12,6 +12,7 @@
#include "base/i18n/rtl.h"
#include "base/memory/scoped_ptr.h"
#include "base/process.h"
+#include "base/timer.h"
#include "content/browser/renderer_host/ime_adapter_android.h"
#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "gpu/command_buffer/common/mailbox.h"
@@ -38,6 +39,7 @@ class WebMouseEvent;
namespace content {
class ContentViewCoreImpl;
+class OverscrollGlow;
class RenderWidgetHost;
class RenderWidgetHostImpl;
class SurfaceTextureTransportClient;
@@ -144,6 +146,9 @@ class RenderWidgetHostViewAndroid : public RenderWidgetHostViewBase {
virtual void HasTouchEventHandlers(bool need_touch_events) OVERRIDE;
virtual void OnSwapCompositorFrame(
scoped_ptr<cc::CompositorFrame> frame) OVERRIDE;
+ virtual void OnOverscrolled(const gfx::Vector2dF& accumulated_overscroll,
+ const gfx::Vector2dF& current_fling_velocity)
+ OVERRIDE;
virtual void ShowDisambiguationPopup(const gfx::Rect& target_rect,
const SkBitmap& zoomed_bitmap) OVERRIDE;
@@ -179,6 +184,11 @@ class RenderWidgetHostViewAndroid : public RenderWidgetHostViewBase {
const gfx::Size texture_size,
const gfx::SizeF content_size,
const base::Closure& ack_callback);
+ void AttachLayers();
+ void RemoveLayers();
+
+ void AnimationCallback();
+ void ScheduleAnimation();
// The model object.
RenderWidgetHostImpl* host_;
@@ -187,7 +197,7 @@ class RenderWidgetHostViewAndroid : public RenderWidgetHostViewBase {
// 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_;
@@ -220,6 +230,10 @@ class RenderWidgetHostViewAndroid : public RenderWidgetHostViewBase {
// The mailbox of the frame we last returned.
gpu::Mailbox last_mailbox_;
+ // Used to render overscroll overlays
+ scoped_ptr<OverscrollGlow> overscroll_effect_;
+ base::OneShotTimer<RenderWidgetHostViewAndroid> animation_timer_;
+
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid);
};

Powered by Google App Engine
This is Rietveld 408576698