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

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: Tests! 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 SelectBetweenCoordinates(const gfx::PointF& start,
220 const gfx::PointF& end) override;
221 virtual void OnSelectionEvent(SelectionEventType event,
222 const gfx::PointF& anchor_position) override;
223 virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() override;
224
215 // Non-virtual methods 225 // Non-virtual methods
216 void SetContentViewCore(ContentViewCoreImpl* content_view_core); 226 void SetContentViewCore(ContentViewCoreImpl* content_view_core);
217 SkColor GetCachedBackgroundColor() const; 227 SkColor GetCachedBackgroundColor() const;
218 void SendKeyEvent(const NativeWebKeyboardEvent& event); 228 void SendKeyEvent(const NativeWebKeyboardEvent& event);
219 void SendMouseEvent(const blink::WebMouseEvent& event); 229 void SendMouseEvent(const blink::WebMouseEvent& event);
220 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); 230 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event);
221 void SendGestureEvent(const blink::WebGestureEvent& event); 231 void SendGestureEvent(const blink::WebGestureEvent& event);
222 232
223 void OnTextInputStateChanged(const ViewHostMsg_TextInputState_Params& params); 233 void OnTextInputStateChanged(const ViewHostMsg_TextInputState_Params& params);
224 void OnDidChangeBodyBackgroundColor(SkColor color); 234 void OnDidChangeBodyBackgroundColor(SkColor color);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 268
259 void SetOverlayVideoMode(bool enabled); 269 void SetOverlayVideoMode(bool enabled);
260 270
261 typedef base::Callback< 271 typedef base::Callback<
262 void(const base::string16& content, int start_offset, int end_offset)> 272 void(const base::string16& content, int start_offset, int end_offset)>
263 TextSurroundingSelectionCallback; 273 TextSurroundingSelectionCallback;
264 void SetTextSurroundingSelectionCallback( 274 void SetTextSurroundingSelectionCallback(
265 const TextSurroundingSelectionCallback& callback); 275 const TextSurroundingSelectionCallback& callback);
266 276
267 private: 277 private:
268 // TouchSelectionControllerClient implementation.
269 virtual bool SupportsAnimation() const override;
270 virtual void SetNeedsAnimate() override;
271 virtual void MoveCaret(const gfx::PointF& position) override;
272 virtual void SelectBetweenCoordinates(const gfx::PointF& start,
273 const gfx::PointF& end) override;
274 virtual void OnSelectionEvent(SelectionEventType event,
275 const gfx::PointF& anchor_position) override;
276 virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() override;
277
278 void RunAckCallbacks(); 278 void RunAckCallbacks();
279 279
280 void DestroyDelegatedContent(); 280 void DestroyDelegatedContent();
281 void SwapDelegatedFrame(uint32 output_surface_id, 281 void SwapDelegatedFrame(uint32 output_surface_id,
282 scoped_ptr<cc::DelegatedFrameData> frame_data); 282 scoped_ptr<cc::DelegatedFrameData> frame_data);
283 void SendDelegatedFrameAck(uint32 output_surface_id); 283 void SendDelegatedFrameAck(uint32 output_surface_id);
284 void SendReturnedDelegatedResources(uint32 output_surface_id); 284 void SendReturnedDelegatedResources(uint32 output_surface_id);
285 285
286 void OnFrameMetadataUpdated( 286 void OnFrameMetadataUpdated(
287 const cc::CompositorFrameMetadata& frame_metadata); 287 const cc::CompositorFrameMetadata& frame_metadata);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 367
368 // The most recent content size that was pushed to the texture layer. 368 // The most recent content size that was pushed to the texture layer.
369 gfx::Size content_size_in_layer_; 369 gfx::Size content_size_in_layer_;
370 370
371 // The output surface id of the last received frame. 371 // The output surface id of the last received frame.
372 uint32_t last_output_surface_id_; 372 uint32_t last_output_surface_id_;
373 373
374 374
375 std::queue<base::Closure> ack_callbacks_; 375 std::queue<base::Closure> ack_callbacks_;
376 376
377 const bool overscroll_effect_enabled_; 377 // Used to control and render overscroll-related effects.
378 // Used to render overscroll overlays. 378 const bool overscroll_controller_enabled_;
379 scoped_ptr<OverscrollGlow> overscroll_effect_; 379 scoped_ptr<OverscrollControllerAndroid> overscroll_controller_;
380 380
381 // Provides gesture synthesis given a stream of touch events (derived from 381 // Provides gesture synthesis given a stream of touch events (derived from
382 // Android MotionEvent's) and touch event acks. 382 // Android MotionEvent's) and touch event acks.
383 ui::FilteredGestureProvider gesture_provider_; 383 ui::FilteredGestureProvider gesture_provider_;
384 384
385 // Handles gesture based text selection 385 // Handles gesture based text selection
386 GestureTextSelector gesture_text_selector_; 386 GestureTextSelector gesture_text_selector_;
387 387
388 // Manages selection handle rendering and manipulation. 388 // Manages selection handle rendering and manipulation.
389 // This will always be NULL if |content_view_core_| is NULL. 389 // This will always be NULL if |content_view_core_| is NULL.
(...skipping 30 matching lines...) Expand all
420 gfx::Vector2dF last_scroll_offset_; 420 gfx::Vector2dF last_scroll_offset_;
421 421
422 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; 422 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_;
423 423
424 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); 424 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid);
425 }; 425 };
426 426
427 } // namespace content 427 } // namespace content
428 428
429 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 429 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698