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

Side by Side 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: Enable by default 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
7 7
8 #include <map> 8 #include <map>
9 #include <queue> 9 #include <queue>
10 10
(...skipping 25 matching lines...) Expand all
36 } 36 }
37 37
38 namespace WebKit { 38 namespace WebKit {
39 class WebExternalTextureLayer; 39 class WebExternalTextureLayer;
40 class WebTouchEvent; 40 class WebTouchEvent;
41 class WebMouseEvent; 41 class WebMouseEvent;
42 } 42 }
43 43
44 namespace content { 44 namespace content {
45 class ContentViewCoreImpl; 45 class ContentViewCoreImpl;
46 class OverscrollGlow;
46 class RenderWidgetHost; 47 class RenderWidgetHost;
47 class RenderWidgetHostImpl; 48 class RenderWidgetHostImpl;
48 class SurfaceTextureTransportClient; 49 class SurfaceTextureTransportClient;
49 struct NativeWebKeyboardEvent; 50 struct NativeWebKeyboardEvent;
50 51
51 // ----------------------------------------------------------------------------- 52 // -----------------------------------------------------------------------------
52 // See comments in render_widget_host_view.h about this class and its members. 53 // See comments in render_widget_host_view.h about this class and its members.
53 // ----------------------------------------------------------------------------- 54 // -----------------------------------------------------------------------------
54 class RenderWidgetHostViewAndroid 55 class RenderWidgetHostViewAndroid
55 : public RenderWidgetHostViewBase, 56 : public RenderWidgetHostViewBase,
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 virtual InputEventAckState FilterInputEvent( 146 virtual InputEventAckState FilterInputEvent(
146 const WebKit::WebInputEvent& input_event) OVERRIDE; 147 const WebKit::WebInputEvent& input_event) OVERRIDE;
147 virtual void OnAccessibilityNotifications( 148 virtual void OnAccessibilityNotifications(
148 const std::vector<AccessibilityHostMsg_NotificationParams>& 149 const std::vector<AccessibilityHostMsg_NotificationParams>&
149 params) OVERRIDE; 150 params) OVERRIDE;
150 virtual bool LockMouse() OVERRIDE; 151 virtual bool LockMouse() OVERRIDE;
151 virtual void UnlockMouse() OVERRIDE; 152 virtual void UnlockMouse() OVERRIDE;
152 virtual void HasTouchEventHandlers(bool need_touch_events) OVERRIDE; 153 virtual void HasTouchEventHandlers(bool need_touch_events) OVERRIDE;
153 virtual void OnSwapCompositorFrame( 154 virtual void OnSwapCompositorFrame(
154 scoped_ptr<cc::CompositorFrame> frame) OVERRIDE; 155 scoped_ptr<cc::CompositorFrame> frame) OVERRIDE;
156 virtual void OnOverscrolled(const gfx::Vector2dF& accumulated_overscroll,
157 const gfx::Vector2dF& current_fling_velocity)
158 OVERRIDE;
155 virtual void ShowDisambiguationPopup(const gfx::Rect& target_rect, 159 virtual void ShowDisambiguationPopup(const gfx::Rect& target_rect,
156 const SkBitmap& zoomed_bitmap) OVERRIDE; 160 const SkBitmap& zoomed_bitmap) OVERRIDE;
157 virtual SmoothScrollGesture* CreateSmoothScrollGesture( 161 virtual SmoothScrollGesture* CreateSmoothScrollGesture(
158 bool scroll_down, int pixels_to_scroll, int mouse_event_x, 162 bool scroll_down, int pixels_to_scroll, int mouse_event_x,
159 int mouse_event_y) OVERRIDE; 163 int mouse_event_y) OVERRIDE;
160 164
161 // cc::TextureLayerClient implementation. 165 // cc::TextureLayerClient implementation.
162 virtual unsigned PrepareTexture(cc::ResourceUpdateQueue* queue) OVERRIDE; 166 virtual unsigned PrepareTexture(cc::ResourceUpdateQueue* queue) OVERRIDE;
163 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; 167 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE;
164 virtual bool PrepareTextureMailbox(cc::TextureMailbox* mailbox) OVERRIDE; 168 virtual bool PrepareTextureMailbox(cc::TextureMailbox* mailbox) OVERRIDE;
(...skipping 26 matching lines...) Expand all
191 bool HasValidFrame() const; 195 bool HasValidFrame() const;
192 196
193 // Select all text between the given coordinates. 197 // Select all text between the given coordinates.
194 void SelectRange(const gfx::Point& start, const gfx::Point& end); 198 void SelectRange(const gfx::Point& start, const gfx::Point& end);
195 199
196 void MoveCaret(const gfx::Point& point); 200 void MoveCaret(const gfx::Point& point);
197 201
198 void RequestContentClipping(const gfx::Rect& clipping, 202 void RequestContentClipping(const gfx::Rect& clipping,
199 const gfx::Size& content_size); 203 const gfx::Size& content_size);
200 204
205 // Returns true when animation ticks are still needed. This avoids a separate
206 // round-trip for requesting follow-up animation.
207 bool Animate(base::TimeTicks frame_time);
208
201 private: 209 private:
202 void BuffersSwapped(const gpu::Mailbox& mailbox, 210 void BuffersSwapped(const gpu::Mailbox& mailbox,
203 const base::Closure& ack_callback); 211 const base::Closure& ack_callback);
204 212
205 void RunAckCallbacks(); 213 void RunAckCallbacks();
206 214
207 void SwapDelegatedFrame(scoped_ptr<cc::DelegatedFrameData> frame_data); 215 void SwapDelegatedFrame(scoped_ptr<cc::DelegatedFrameData> frame_data);
208 void SendDelegatedFrameAck(); 216 void SendDelegatedFrameAck();
209 217
210 void ComputeContentsSize(const cc::CompositorFrame* frame); 218 void ComputeContentsSize(const cc::CompositorFrame* frame);
211 void ResetClipping(); 219 void ResetClipping();
212 void ClipContents(const gfx::Rect& clipping, const gfx::Size& content_size); 220 void ClipContents(const gfx::Rect& clipping, const gfx::Size& content_size);
213 221
222 void AttachLayers();
223 void RemoveLayers();
224
225 void UpdateAnimationSize(const cc::CompositorFrame* frame);
226 void ScheduleAnimationIfNecessary();
227
214 // The model object. 228 // The model object.
215 RenderWidgetHostImpl* host_; 229 RenderWidgetHostImpl* host_;
216 230
217 // Whether or not this widget is potentially attached to the view hierarchy. 231 // Whether or not this widget is potentially attached to the view hierarchy.
218 // This view may not actually be attached if this is true, but it should be 232 // This view may not actually be attached if this is true, but it should be
219 // treated as such, because as soon as a ContentViewCore is set the layer 233 // treated as such, because as soon as a ContentViewCore is set the layer
220 // will be attached automatically. 234 // will be attached automatically.
221 bool is_layer_attached_; 235 bool are_layers_attached_;
222 236
223 // ContentViewCoreImpl is our interface to the view system. 237 // ContentViewCoreImpl is our interface to the view system.
224 ContentViewCoreImpl* content_view_core_; 238 ContentViewCoreImpl* content_view_core_;
225 239
226 ImeAdapterAndroid ime_adapter_android_; 240 ImeAdapterAndroid ime_adapter_android_;
227 241
228 // Body background color of the underlying document. 242 // Body background color of the underlying document.
229 SkColor cached_background_color_; 243 SkColor cached_background_color_;
230 244
231 // The texture layer for this view when using browser-side compositing. 245 // The texture layer for this view when using browser-side compositing.
(...skipping 21 matching lines...) Expand all
253 // The mailbox of the previously received frame. 267 // The mailbox of the previously received frame.
254 gpu::Mailbox current_mailbox_; 268 gpu::Mailbox current_mailbox_;
255 269
256 // The mailbox of the frame we last returned. 270 // The mailbox of the frame we last returned.
257 gpu::Mailbox last_mailbox_; 271 gpu::Mailbox last_mailbox_;
258 272
259 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; 273 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_;
260 274
261 std::queue<base::Closure> ack_callbacks_; 275 std::queue<base::Closure> ack_callbacks_;
262 276
277 // Used to render overscroll overlays.
278 scoped_ptr<OverscrollGlow> overscroll_effect_;
279
263 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); 280 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid);
264 }; 281 };
265 282
266 } // namespace content 283 } // namespace content
267 284
268 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 285 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698