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

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: Rebase 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 void Animate(base::TimeTicks frame_time);
206
201 private: 207 private:
202 void BuffersSwapped(const gpu::Mailbox& mailbox, 208 void BuffersSwapped(const gpu::Mailbox& mailbox,
203 const base::Closure& ack_callback); 209 const base::Closure& ack_callback);
204 210
205 void RunAckCallbacks(); 211 void RunAckCallbacks();
206 212
207 void SwapDelegatedFrame(scoped_ptr<cc::DelegatedFrameData> frame_data); 213 void SwapDelegatedFrame(scoped_ptr<cc::DelegatedFrameData> frame_data);
208 void SendDelegatedFrameAck(); 214 void SendDelegatedFrameAck();
209 215
210 void ComputeContentsSize(const cc::CompositorFrame* frame); 216 void ComputeContentsSize(const cc::CompositorFrame* frame);
211 void ResetClipping(); 217 void ResetClipping();
212 void ClipContents(const gfx::Rect& clipping, const gfx::Size& content_size); 218 void ClipContents(const gfx::Rect& clipping, const gfx::Size& content_size);
213 219
220 void AttachLayers();
221 void RemoveLayers();
222
223 void UpdateAnimationSize(const cc::CompositorFrame* frame);
224 void ScheduleAnimationIfNecessary();
225
214 // The model object. 226 // The model object.
215 RenderWidgetHostImpl* host_; 227 RenderWidgetHostImpl* host_;
216 228
217 // Whether or not this widget is potentially attached to the view hierarchy. 229 // 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 230 // 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 231 // treated as such, because as soon as a ContentViewCore is set the layer
220 // will be attached automatically. 232 // will be attached automatically.
221 bool is_layer_attached_; 233 bool are_layers_attached_;
222 234
223 // ContentViewCoreImpl is our interface to the view system. 235 // ContentViewCoreImpl is our interface to the view system.
224 ContentViewCoreImpl* content_view_core_; 236 ContentViewCoreImpl* content_view_core_;
225 237
226 ImeAdapterAndroid ime_adapter_android_; 238 ImeAdapterAndroid ime_adapter_android_;
227 239
228 // Body background color of the underlying document. 240 // Body background color of the underlying document.
229 SkColor cached_background_color_; 241 SkColor cached_background_color_;
230 242
231 // The texture layer for this view when using browser-side compositing. 243 // 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. 265 // The mailbox of the previously received frame.
254 gpu::Mailbox current_mailbox_; 266 gpu::Mailbox current_mailbox_;
255 267
256 // The mailbox of the frame we last returned. 268 // The mailbox of the frame we last returned.
257 gpu::Mailbox last_mailbox_; 269 gpu::Mailbox last_mailbox_;
258 270
259 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; 271 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_;
260 272
261 std::queue<base::Closure> ack_callbacks_; 273 std::queue<base::Closure> ack_callbacks_;
262 274
275 // Used to render overscroll overlays
Sami 2013/05/10 10:47:57 Nit: end comments with a period.
jdduke (slow) 2013/05/10 16:39:52 Done.
276 scoped_ptr<OverscrollGlow> overscroll_effect_;
277
263 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); 278 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid);
264 }; 279 };
265 280
266 } // namespace content 281 } // namespace content
267 282
268 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 283 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698