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 e6257f2edfcb0b614ea060f9ff61bd473e5c08cc..f7690667d88ea89705963f6db56bff8b269ff690 100644 |
--- a/content/browser/renderer_host/render_widget_host_view_android.cc |
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc |
@@ -269,6 +269,9 @@ scoped_ptr<ui::TouchSelectionController> CreateSelectionController( |
gfx::ViewConfiguration::GetLongPressTimeoutInMs()); |
config.tap_slop = gfx::ViewConfiguration::GetTouchSlopInDips(); |
config.show_on_tap_for_empty_editable = false; |
+ // TODO(aviD): Enable adaptive handle orientation after behavior is |
+ // consistent on webview |
jdduke (slow)
2015/09/09 22:19:50
Please keep the flag check here, otherwise it's of
AviD
2015/09/10 06:06:13
Done.
|
+ config.enable_adaptive_handle_orientation = false; |
config.enable_longpress_drag_selection = |
base::CommandLine::ForCurrentProcess()->HasSwitch( |
switches::kEnableLongpressDragSelection); |
@@ -1318,6 +1321,15 @@ void RenderWidgetHostViewAndroid::OnFrameMetadataUpdated( |
selection_controller_->OnSelectionBoundsChanged( |
ConvertSelectionBound(frame_metadata.selection.start), |
ConvertSelectionBound(frame_metadata.selection.end)); |
+ |
+ // Set parameters for adaptive handle orientation. |
+ gfx::SizeF viewport_size(frame_metadata.scrollable_viewport_size); |
+ viewport_size.Scale(frame_metadata.page_scale_factor); |
+ gfx::RectF viewport_rect( |
+ frame_metadata.location_bar_content_translation.x(), |
+ frame_metadata.location_bar_content_translation.y(), |
+ viewport_size.width(), viewport_size.height()); |
+ selection_controller_->OnViewportChanged(viewport_rect); |
} |
// All offsets and sizes are in CSS pixels. |