Chromium Code Reviews| 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 062ad08ff44756ac344e7a8bee7ed3671007b692..d9c83c423b7aa84398dfdb093db8682780640d03 100644 |
| --- a/content/browser/renderer_host/render_widget_host_view_android.cc |
| +++ b/content/browser/renderer_host/render_widget_host_view_android.cc |
| @@ -25,6 +25,7 @@ |
| #include "cc/output/compositor_frame_ack.h" |
| #include "cc/output/copy_output_request.h" |
| #include "cc/output/copy_output_result.h" |
| +#include "cc/output/viewport_selection_bound.h" |
| #include "cc/resources/single_release_callback.h" |
| #include "cc/trees/layer_tree_host.h" |
| #include "content/browser/accessibility/browser_accessibility_manager_android.h" |
| @@ -776,31 +777,32 @@ void RenderWidgetHostViewAndroid::SelectionBoundsChanged( |
| if (!selection_controller_) |
| return; |
| - gfx::RectF anchor_rect(params.anchor_rect); |
| - gfx::RectF focus_rect(params.focus_rect); |
| + gfx::RectF start_rect(params.anchor_rect); |
|
aelias_OOO_until_Jul13
2014/08/20 21:41:03
Can you go ahead and change ViewHostMsg_SelectionB
jdduke (slow)
2014/08/20 21:58:43
I could, except there's a good amount of dependent
|
| + gfx::RectF end_rect(params.focus_rect); |
| if (params.is_anchor_first) |
| - std::swap(anchor_rect, focus_rect); |
| + std::swap(start_rect, end_rect); |
| + |
| + cc::ViewportSelectionBound start_bound, end_bound; |
| + start_bound.visible = true; |
| + end_bound.visible = true; |
| + start_bound.edge_top = start_rect.origin(); |
| + start_bound.edge_bottom = start_rect.bottom_left(); |
|
aelias_OOO_until_Jul13
2014/08/20 21:41:03
If we have to stay with the rect for some reason,
jdduke (slow)
2014/08/20 21:58:44
This code will all be ripped out in https://codere
|
| + end_bound.edge_top = end_rect.origin(); |
| + end_bound.edge_bottom = end_rect.bottom_left(); |
| - TouchHandleOrientation anchor_orientation(TOUCH_HANDLE_ORIENTATION_UNDEFINED); |
| - TouchHandleOrientation focus_orientation(TOUCH_HANDLE_ORIENTATION_UNDEFINED); |
| if (params.anchor_rect == params.focus_rect) { |
| if (params.anchor_rect.x() && params.anchor_rect.y()) |
| - anchor_orientation = focus_orientation = TOUCH_HANDLE_CENTER; |
| + start_bound.type = end_bound.type = cc::SELECTION_BOUND_CENTER; |
| } else { |
| - anchor_orientation = params.anchor_dir == blink::WebTextDirectionRightToLeft |
| - ? TOUCH_HANDLE_LEFT |
| - : TOUCH_HANDLE_RIGHT; |
| - focus_orientation = params.focus_dir == blink::WebTextDirectionRightToLeft |
| - ? TOUCH_HANDLE_RIGHT |
| - : TOUCH_HANDLE_LEFT; |
| + start_bound.type = params.anchor_dir == blink::WebTextDirectionRightToLeft |
| + ? cc::SELECTION_BOUND_LEFT |
| + : cc::SELECTION_BOUND_RIGHT; |
| + end_bound.type = params.focus_dir == blink::WebTextDirectionRightToLeft |
| + ? cc::SELECTION_BOUND_RIGHT |
| + : cc::SELECTION_BOUND_LEFT; |
| } |
| - selection_controller_->OnSelectionBoundsChanged(anchor_rect, |
| - anchor_orientation, |
| - true, |
| - focus_rect, |
| - focus_orientation, |
| - true); |
| + selection_controller_->OnSelectionBoundsChanged(start_bound, end_bound); |
| } |
| void RenderWidgetHostViewAndroid::SetBackgroundOpaque(bool opaque) { |
| @@ -1496,15 +1498,17 @@ void RenderWidgetHostViewAndroid::OnShowingPastePopup( |
| // of the region have been updated, explicitly set the properties now. |
| // TODO(jdduke): Remove this workaround when auxiliary paste popup |
| // notifications are no longer required, crbug.com/398170. |
| - gfx::RectF rect(point, gfx::SizeF()); |
| - TouchHandleOrientation orientation = TOUCH_HANDLE_CENTER; |
| - const bool visible = true; |
| + cc::ViewportSelectionBound insertion_bound; |
| + insertion_bound.type = cc::SELECTION_BOUND_LEFT; |
| + insertion_bound.visible = true; |
| + insertion_bound.edge_top = point; |
| + insertion_bound.edge_bottom = point; |
| HideTextHandles(); |
| ShowSelectionHandlesAutomatically(); |
| selection_controller_->OnSelectionEditable(true); |
| selection_controller_->OnSelectionEmpty(true); |
| - selection_controller_->OnSelectionBoundsChanged( |
| - rect, orientation, visible, rect, orientation, visible); |
| + selection_controller_->OnSelectionBoundsChanged(insertion_bound, |
| + insertion_bound); |
| } |
| SkColor RenderWidgetHostViewAndroid::GetCachedBackgroundColor() const { |