Index: content/browser/renderer_host/render_widget_host_view_android.cc |
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc |
index dac39c7205f3b9e43634c0cb47eb5f2841c704fc..91e6a49befebd92de7fd6909e0746b5443fef141 100644 |
--- a/content/browser/renderer_host/render_widget_host_view_android.cc |
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc |
@@ -189,6 +189,8 @@ RenderWidgetHostViewAndroid::RenderWidgetHostViewAndroid( |
gesture_provider_(CreateGestureProviderConfig(), this), |
flush_input_requested_(false), |
accelerated_surface_route_id_(0), |
+ cached_selection_anchor_visible_(false), |
+ cached_selection_focus_visible_(false), |
using_synchronous_compositor_(SynchronousCompositorImpl::FromID( |
widget_host->GetProcess()->GetID(), |
widget_host->GetRoutingID()) != NULL), |
@@ -635,9 +637,29 @@ void RenderWidgetHostViewAndroid::SelectionChanged(const base::string16& text, |
void RenderWidgetHostViewAndroid::SelectionBoundsChanged( |
const ViewHostMsg_SelectionBounds_Params& params) { |
- if (content_view_core_) { |
- content_view_core_->OnSelectionBoundsChanged(params); |
- } |
+ if (!content_view_core_) |
+ return; |
+ |
+ const gfx::PointF anchor = params.anchor_rect.bottom_left(); |
+ const gfx::PointF focus = params.focus_rect.bottom_left(); |
+ |
+ if (cached_selection_anchor_ == anchor && cached_selection_focus_ == focus && |
+ cached_selection_anchor_visible_ == params.is_anchor_visible && |
+ cached_selection_focus_visible_ == params.is_focus_visible) |
+ return; |
+ |
+ cached_selection_anchor_ = anchor; |
+ cached_selection_focus_ = focus; |
+ cached_selection_anchor_visible_ = params.is_anchor_visible; |
+ cached_selection_focus_visible_ = params.is_focus_visible; |
+ |
+ content_view_core_->OnSelectionBoundsChanged(anchor, |
+ focus, |
+ params.anchor_dir, |
+ params.focus_dir, |
+ params.is_anchor_first, |
+ params.is_anchor_visible, |
+ params.is_focus_visible); |
} |
void RenderWidgetHostViewAndroid::ScrollOffsetChanged() { |
@@ -985,6 +1007,7 @@ void RenderWidgetHostViewAndroid::OnFrameMetadataUpdated( |
frame_metadata.location_bar_offset, |
frame_metadata.location_bar_content_translation, |
frame_metadata.overdraw_bottom_height); |
+ |
#if defined(VIDEO_HOLE) |
if (host_ && host_->IsRenderView()) { |
RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>( |