Index: content/browser/renderer_host/render_widget_host_view_android.h |
diff --git a/content/browser/renderer_host/render_widget_host_view_android.h b/content/browser/renderer_host/render_widget_host_view_android.h |
index bcecff8156709bd70e0d3fdf2f84b0d98b43dc88..b60a082ed7001b6a8e9b25aa4538c85fec790d11 100644 |
--- a/content/browser/renderer_host/render_widget_host_view_android.h |
+++ b/content/browser/renderer_host/render_widget_host_view_android.h |
@@ -21,6 +21,7 @@ |
#include "content/browser/renderer_host/image_transport_factory_android.h" |
#include "content/browser/renderer_host/ime_adapter_android.h" |
#include "content/browser/renderer_host/input/gesture_text_selector.h" |
+#include "content/browser/renderer_host/input/touch_selection_controller.h" |
#include "content/browser/renderer_host/render_widget_host_view_base.h" |
#include "content/common/content_export.h" |
#include "gpu/command_buffer/common/mailbox.h" |
@@ -67,7 +68,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid |
public ui::GestureProviderClient, |
public ui::WindowAndroidObserver, |
public DelegatedFrameEvictorClient, |
- public GestureTextSelectorClient { |
+ public GestureTextSelectorClient, |
+ public TouchSelectionControllerClient { |
public: |
RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, |
ContentViewCoreImpl* content_view_core); |
@@ -211,6 +213,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid |
const gfx::Rect rect); |
bool OnTouchEvent(const ui::MotionEvent& event); |
+ bool OnTouchHandleEvent(const ui::MotionEvent& event); |
void ResetGestureDetection(); |
void SetDoubleTapSupportEnabled(bool enabled); |
void SetMultiTouchZoomSupportEnabled(bool enabled); |
@@ -228,6 +231,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid |
bool HasValidFrame() const; |
void MoveCaret(const gfx::Point& point); |
+ void HideTextHandles(); |
void SynchronousFrameMetadata( |
const cc::CompositorFrameMetadata& frame_metadata); |
@@ -241,6 +245,16 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid |
const TextSurroundingSelectionCallback& callback); |
private: |
+ // TouchSelectionControllerClient implementation. |
+ virtual bool SupportsAnimation() const OVERRIDE; |
+ virtual void SetNeedsAnimate() OVERRIDE; |
+ virtual void MoveCaret(const gfx::PointF& position) OVERRIDE; |
+ virtual void SelectBetweenCoordinates(const gfx::PointF& start, |
+ const gfx::PointF& end) OVERRIDE; |
+ virtual void OnSelectionEvent(SelectionEventType event, |
+ const gfx::PointF& anchor_position) OVERRIDE; |
+ virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() OVERRIDE; |
+ |
void RunAckCallbacks(); |
void DestroyDelegatedContent(); |
@@ -295,9 +309,10 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid |
void InternalSwapCompositorFrame(uint32 output_surface_id, |
scoped_ptr<cc::CompositorFrame> frame); |
- void SetNeedsAnimate(); |
bool Animate(base::TimeTicks frame_time); |
+ float GetDpiScale() const; |
+ |
// The model object. |
RenderWidgetHostImpl* host_; |
@@ -346,6 +361,10 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid |
// Handles gesture based text selection |
GestureTextSelector gesture_text_selector_; |
+ // Manages selection handle rendering and manipulation. |
+ // This will always be NULL if |content_view_core_| is NULL. |
+ scoped_ptr<TouchSelectionController> selection_controller_; |
+ |
bool flush_input_requested_; |
int accelerated_surface_route_id_; |
@@ -353,10 +372,6 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid |
// Size to use if we have no backing ContentViewCore |
gfx::Size default_size_; |
- // Cached selection bounds to avoid redundant selection handle updates. |
- cc::ViewportSelectionBound cached_selection_start_; |
- cc::ViewportSelectionBound cached_selection_end_; |
- |
const bool using_synchronous_compositor_; |
scoped_ptr<DelegatedFrameEvictor> frame_evictor_; |