Index: content/renderer/render_view_impl.cc |
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc |
index 7f2efd89b77b28957981ce8b302dd153136f6b1f..b332b7fdfe209193153a47c5860e3a6078bfeb50 100644 |
--- a/content/renderer/render_view_impl.cc |
+++ b/content/renderer/render_view_impl.cc |
@@ -6220,37 +6220,45 @@ bool RenderViewImpl::didTapMultipleTargets( |
if (!new_total_scale) |
return false; |
- gfx::Size canvas_size = gfx::ToCeiledSize(gfx::ScaleSize(zoom_rect.size(), |
- new_total_scale)); |
- TransportDIB* transport_dib = NULL; |
- { |
- scoped_ptr<skia::PlatformCanvas> canvas( |
- RenderProcess::current()->GetDrawingCanvas(&transport_dib, |
- gfx::Rect(canvas_size))); |
- if (!canvas) |
- return false; |
- |
- // TODO(trchen): Cleanup the device scale factor mess. |
- // device scale will be applied in WebKit |
- // --> zoom_rect doesn't include device scale, |
- // but WebKit will still draw on zoom_rect * device_scale_factor_ |
- canvas->scale(new_total_scale / device_scale_factor_, |
- new_total_scale / device_scale_factor_); |
- canvas->translate(-zoom_rect.x() * device_scale_factor_, |
- -zoom_rect.y() * device_scale_factor_); |
- |
- webwidget_->paint( |
- canvas.get(), |
- zoom_rect, |
- WebWidget::ForceSoftwareRenderingAndIgnoreGPUResidentContent); |
- } |
- |
- gfx::Rect physical_window_zoom_rect = gfx::ToEnclosingRect( |
- ClientRectToPhysicalWindowRect(gfx::RectF(zoom_rect))); |
- Send(new ViewHostMsg_ShowDisambiguationPopup(routing_id_, |
- physical_window_zoom_rect, |
- canvas_size, |
- transport_dib->id())); |
+ TapMultipleTargetsStrategy multitarget_strategy = |
+ renderer_preferences_.tap_multiple_targets_strategy; |
+ if (multitarget_strategy == TAP_MULTIPLE_TARGETS_STRATEGY_ZOOM) { |
+ return webview()->zoomToMultipleTargetsRect(zoom_rect); |
+ } else if (multitarget_strategy == TAP_MULTIPLE_TARGETS_STRATEGY_POPUP) { |
+ gfx::Size canvas_size = |
+ gfx::ToCeiledSize(gfx::ScaleSize(zoom_rect.size(), new_total_scale)); |
+ TransportDIB* transport_dib = NULL; |
+ { |
+ scoped_ptr<skia::PlatformCanvas> canvas( |
+ RenderProcess::current()->GetDrawingCanvas(&transport_dib, |
+ gfx::Rect(canvas_size))); |
+ if (!canvas) |
+ return false; |
+ |
+ // TODO(trchen): Cleanup the device scale factor mess. |
+ // device scale will be applied in WebKit |
+ // --> zoom_rect doesn't include device scale, |
+ // but WebKit will still draw on zoom_rect * device_scale_factor_ |
+ canvas->scale(new_total_scale / device_scale_factor_, |
+ new_total_scale / device_scale_factor_); |
+ canvas->translate(-zoom_rect.x() * device_scale_factor_, |
+ -zoom_rect.y() * device_scale_factor_); |
+ |
+ webwidget_->paint( |
+ canvas.get(), |
+ zoom_rect, |
+ WebWidget::ForceSoftwareRenderingAndIgnoreGPUResidentContent); |
+ } |
+ |
+ gfx::Rect physical_window_zoom_rect = gfx::ToEnclosingRect( |
+ ClientRectToPhysicalWindowRect(gfx::RectF(zoom_rect))); |
+ Send(new ViewHostMsg_ShowDisambiguationPopup(routing_id_, |
+ physical_window_zoom_rect, |
+ canvas_size, |
+ transport_dib->id())); |
+ } else { |
+ return false; |
+ } |
return true; |
} |