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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java

Issue 2892203002: Android UrlBar: Fix scrolling to most-significant part of RTL domains. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
index 50f73c44dda4c89951c8ba5241171241b6483984..f0c4e28f50f1ebc13f130246176aec3253084c3e 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
@@ -626,7 +626,16 @@ public class UrlBar extends AutocompleteEditText {
}
}
- setSelection(urlComponents.first.length());
+ // We want to bring the end of the domain into view. But since we want
+ // to bias towards displaying the beginning of the URL as well, first
+ // we bring the beginning into view. We can't use offset 0, because
+ // this TextView is in force-LTR mode, and for RTL domains, offset 0 is
+ // outside the RTL-extent that contains the domain. crbug.com/723100
+ if (urlComponents.first.length() > 1) {
+ bringPointIntoView(1);
+ }
+ bringPointIntoView(urlComponents.first.length());
+
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698