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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.h

Issue 335943002: [Android] Composited selection handle rendering (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@input_native_handles_final
Patch Set: Clean up paste popup interaction Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
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 11534a547c98086346ba926aac4d32552cf61483..0e0d19c22fca59f9a239681b89e971f1bfd710c4 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);
@@ -210,6 +212,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);
@@ -227,6 +230,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid
bool HasValidFrame() const;
void MoveCaret(const gfx::Point& point);
+ void HideTextHandles();
void SynchronousFrameMetadata(
const cc::CompositorFrameMetadata& frame_metadata);
@@ -240,6 +244,15 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid
const TextSurroundingSelectionCallback& callback);
private:
+ // TouchSelectionControllerClient implementation.
+ 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();
@@ -294,9 +307,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_;
@@ -345,6 +359,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_;
@@ -352,10 +370,6 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid
// Size to use if we have no backing ContentViewCore
gfx::Size default_size_;
- // Cached rectangles for the selection anchor and focus.
- cc::ViewportSelectionBound cached_selection_anchor_;
- cc::ViewportSelectionBound cached_selection_focus_;
-
const bool using_synchronous_compositor_;
scoped_ptr<DelegatedFrameEvictor> frame_evictor_;

Powered by Google App Engine
This is Rietveld 408576698