Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1182)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/input/SelectionHandleController.java

Issue 300323005: Route selection bounds updates through the compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Defer selection updates until after compositor scheduling Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/android/java/src/org/chromium/content/browser/input/SelectionHandleController.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/SelectionHandleController.java b/content/public/android/java/src/org/chromium/content/browser/input/SelectionHandleController.java
index 0edf5519b955d1c3656e296d02539129b86b1cdd..6a623b10e965d28e1f548aead109d2bb04f3d8e0 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/SelectionHandleController.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/SelectionHandleController.java
@@ -179,7 +179,7 @@ public abstract class SelectionHandleController implements CursorController {
*/
public void showHandles(int startDir, int endDir) {
createHandlesIfNeeded(startDir, endDir);
- showHandlesIfNeeded();
+ showHandlesIfNeeded(startDir, endDir);
}
@VisibleForTesting
@@ -205,12 +205,15 @@ public abstract class SelectionHandleController implements CursorController {
}
}
- private void showHandlesIfNeeded() {
- if (!mIsShowing) {
- mIsShowing = true;
- mStartHandle.show();
- mEndHandle.show();
- setHandleVisibility(HandleView.VISIBLE);
- }
+ private void showHandlesIfNeeded(int startDir, int endDir) {
+ if (mIsShowing) return;
+ mIsShowing = true;
+ mStartHandle.show();
+ mEndHandle.show();
+ mStartHandle.setOrientation(
+ startDir == TEXT_DIRECTION_RTL ? HandleView.RIGHT : HandleView.LEFT);
+ mEndHandle.setOrientation(
+ startDir == TEXT_DIRECTION_RTL ? HandleView.LEFT : HandleView.RIGHT);
+ setHandleVisibility(HandleView.VISIBLE);
}
}

Powered by Google App Engine
This is Rietveld 408576698