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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.h

Issue 679493002: [Android] Add a native pull-to-refresh overscroll effect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix lint Created 6 years, 1 month 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 43
44 namespace blink { 44 namespace blink {
45 class WebExternalTextureLayer; 45 class WebExternalTextureLayer;
46 class WebTouchEvent; 46 class WebTouchEvent;
47 class WebMouseEvent; 47 class WebMouseEvent;
48 } 48 }
49 49
50 namespace content { 50 namespace content {
51 class ContentViewCoreImpl; 51 class ContentViewCoreImpl;
52 class OverscrollGlow; 52 class OverscrollControllerAndroid;
53 class RenderWidgetHost; 53 class RenderWidgetHost;
54 class RenderWidgetHostImpl; 54 class RenderWidgetHostImpl;
55 struct DidOverscrollParams; 55 struct DidOverscrollParams;
56 struct NativeWebKeyboardEvent; 56 struct NativeWebKeyboardEvent;
57 57
58 class ReadbackRequest { 58 class ReadbackRequest {
59 public: 59 public:
60 explicit ReadbackRequest( 60 explicit ReadbackRequest(
61 float scale, 61 float scale,
62 SkColorType color_type, 62 SkColorType color_type,
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 // DelegatedFrameEvictor implementation 205 // DelegatedFrameEvictor implementation
206 virtual void EvictDelegatedFrame() override; 206 virtual void EvictDelegatedFrame() override;
207 207
208 virtual SkColorType PreferredReadbackFormat() override; 208 virtual SkColorType PreferredReadbackFormat() override;
209 209
210 // GestureTextSelectorClient implementation. 210 // GestureTextSelectorClient implementation.
211 virtual void ShowSelectionHandlesAutomatically() override; 211 virtual void ShowSelectionHandlesAutomatically() override;
212 virtual void SelectRange(float x1, float y1, float x2, float y2) override; 212 virtual void SelectRange(float x1, float y1, float x2, float y2) override;
213 virtual void LongPress(base::TimeTicks time, float x, float y) override; 213 virtual void LongPress(base::TimeTicks time, float x, float y) override;
214 214
215 // TouchSelectionControllerClient implementation.
216 virtual bool SupportsAnimation() const override;
217 virtual void SetNeedsAnimate() override;
218 virtual void MoveCaret(const gfx::PointF& position) override;
219 virtual void MoveRangeSelectionExtent(const gfx::PointF& extent) override;
220 virtual void SelectBetweenCoordinates(const gfx::PointF& base,
221 const gfx::PointF& extent) override;
222 virtual void OnSelectionEvent(SelectionEventType event,
223 const gfx::PointF& anchor_position) override;
224 virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() override;
225
215 // Non-virtual methods 226 // Non-virtual methods
216 void SetContentViewCore(ContentViewCoreImpl* content_view_core); 227 void SetContentViewCore(ContentViewCoreImpl* content_view_core);
217 SkColor GetCachedBackgroundColor() const; 228 SkColor GetCachedBackgroundColor() const;
218 void SendKeyEvent(const NativeWebKeyboardEvent& event); 229 void SendKeyEvent(const NativeWebKeyboardEvent& event);
219 void SendMouseEvent(const blink::WebMouseEvent& event); 230 void SendMouseEvent(const blink::WebMouseEvent& event);
220 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); 231 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event);
221 void SendGestureEvent(const blink::WebGestureEvent& event); 232 void SendGestureEvent(const blink::WebGestureEvent& event);
222 233
223 void OnTextInputStateChanged(const ViewHostMsg_TextInputState_Params& params); 234 void OnTextInputStateChanged(const ViewHostMsg_TextInputState_Params& params);
224 void OnDidChangeBodyBackgroundColor(SkColor color); 235 void OnDidChangeBodyBackgroundColor(SkColor color);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 270
260 void SetOverlayVideoMode(bool enabled); 271 void SetOverlayVideoMode(bool enabled);
261 272
262 typedef base::Callback< 273 typedef base::Callback<
263 void(const base::string16& content, int start_offset, int end_offset)> 274 void(const base::string16& content, int start_offset, int end_offset)>
264 TextSurroundingSelectionCallback; 275 TextSurroundingSelectionCallback;
265 void SetTextSurroundingSelectionCallback( 276 void SetTextSurroundingSelectionCallback(
266 const TextSurroundingSelectionCallback& callback); 277 const TextSurroundingSelectionCallback& callback);
267 278
268 private: 279 private:
269 // TouchSelectionControllerClient implementation.
270 virtual bool SupportsAnimation() const override;
271 virtual void SetNeedsAnimate() override;
272 virtual void MoveCaret(const gfx::PointF& position) override;
273 virtual void MoveRangeSelectionExtent(const gfx::PointF& extent) override;
274 virtual void SelectBetweenCoordinates(const gfx::PointF& base,
275 const gfx::PointF& extent) override;
276 virtual void OnSelectionEvent(SelectionEventType event,
277 const gfx::PointF& anchor_position) override;
278 virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() override;
279
280 void RunAckCallbacks(); 280 void RunAckCallbacks();
281 281
282 void DestroyDelegatedContent(); 282 void DestroyDelegatedContent();
283 void SwapDelegatedFrame(uint32 output_surface_id, 283 void SwapDelegatedFrame(uint32 output_surface_id,
284 scoped_ptr<cc::DelegatedFrameData> frame_data); 284 scoped_ptr<cc::DelegatedFrameData> frame_data);
285 void SendDelegatedFrameAck(uint32 output_surface_id); 285 void SendDelegatedFrameAck(uint32 output_surface_id);
286 void SendReturnedDelegatedResources(uint32 output_surface_id); 286 void SendReturnedDelegatedResources(uint32 output_surface_id);
287 287
288 void OnFrameMetadataUpdated( 288 void OnFrameMetadataUpdated(
289 const cc::CompositorFrameMetadata& frame_metadata); 289 const cc::CompositorFrameMetadata& frame_metadata);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 369
370 // The most recent content size that was pushed to the texture layer. 370 // The most recent content size that was pushed to the texture layer.
371 gfx::Size content_size_in_layer_; 371 gfx::Size content_size_in_layer_;
372 372
373 // The output surface id of the last received frame. 373 // The output surface id of the last received frame.
374 uint32_t last_output_surface_id_; 374 uint32_t last_output_surface_id_;
375 375
376 376
377 std::queue<base::Closure> ack_callbacks_; 377 std::queue<base::Closure> ack_callbacks_;
378 378
379 const bool overscroll_effect_enabled_; 379 // Used to control and render overscroll-related effects.
380 // Used to render overscroll overlays. 380 const bool overscroll_controller_enabled_;
381 scoped_ptr<OverscrollGlow> overscroll_effect_; 381 scoped_ptr<OverscrollControllerAndroid> overscroll_controller_;
382 382
383 // Provides gesture synthesis given a stream of touch events (derived from 383 // Provides gesture synthesis given a stream of touch events (derived from
384 // Android MotionEvent's) and touch event acks. 384 // Android MotionEvent's) and touch event acks.
385 ui::FilteredGestureProvider gesture_provider_; 385 ui::FilteredGestureProvider gesture_provider_;
386 386
387 // Handles gesture based text selection 387 // Handles gesture based text selection
388 GestureTextSelector gesture_text_selector_; 388 GestureTextSelector gesture_text_selector_;
389 389
390 // Manages selection handle rendering and manipulation. 390 // Manages selection handle rendering and manipulation.
391 // This will always be NULL if |content_view_core_| is NULL. 391 // This will always be NULL if |content_view_core_| is NULL.
(...skipping 30 matching lines...) Expand all
422 gfx::Vector2dF last_scroll_offset_; 422 gfx::Vector2dF last_scroll_offset_;
423 423
424 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; 424 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_;
425 425
426 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); 426 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid);
427 }; 427 };
428 428
429 } // namespace content 429 } // namespace content
430 430
431 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 431 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698