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