Commit f5164b9f authored by pedrosimonetti's avatar pedrosimonetti Committed by Commit bot

[Contextual Search] Pass selection coordinate to ContentViewClient.

BUG=415656

Review URL: https://codereview.chromium.org/583583005

Cr-Commit-Position: refs/heads/master@{#295802}
parent 5bbc0453
......@@ -131,12 +131,24 @@ public class ContentViewClient {
/**
* Notification that a selection or insertion-related event has occurred.
* TODO(donnd): Remove this and instead expose a ContextualSearchClient, crbug.com/403001.
* TODO(pedrosimonetti): remove this method once downstream code has been updated to use
* the other signature.
* @param eventType The selection event type, see {@link SelectionEventType}.
*/
public void onSelectionEvent(int eventType) {
}
/**
* Notification that a selection or insertion-related event has occurred.
* TODO(donnd): Remove this and instead expose a ContextualSearchClient, crbug.com/403001.
* @param eventType The selection event type, see {@link SelectionEventType}.
* @param posXPix The x coordinate of the selection start handle.
* @param posYPix The y coordinate of the selection start handle.
*/
public void onSelectionEvent(int eventType, float posXPix, float posYPix) {
onSelectionEvent(eventType);
}
/**
* Called when a new content intent is requested to be started.
*/
......
......@@ -2021,7 +2021,9 @@ public class ContentViewCore
default:
assert false : "Invalid selection event type.";
}
getContentViewClient().onSelectionEvent(eventType);
final float scale = mRenderCoordinates.getDeviceScaleFactor();
getContentViewClient().onSelectionEvent(eventType, posXDip * scale, posYDip * scale);
}
private void hideTextHandles() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment