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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java

Issue 2076303002: Delete query in omnibox code. R.I.P. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused header. Created 4 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: chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java
index b75e8c948a85f7dd135334651e92ae2b843fe746..b51bfeb9f1263126bac8af3ca6872cf564bacf92 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java
@@ -1681,32 +1681,29 @@ public class ToolbarPhone extends ToolbarLayout
if (isLocationBarShownInNTP() && mNtpSearchBoxScrollPercent == 0f) return;
- if (!FeatureUtilities.isDocumentMode(getContext())
- || mPhoneLocationBar.showingQueryInTheOmnibox()) {
- // The call to getLayout() can return null briefly during text changes, but as it
- // is only needed for RTL calculations, we proceed if the location bar is showing
- // LTR content.
- boolean isLocationBarRtl = ApiCompatibilityUtils.isLayoutRtl(mPhoneLocationBar);
- if (!isLocationBarRtl || mUrlBar.getLayout() != null) {
- int urlBarStartScrollX = 0;
- if (isLocationBarRtl) {
- urlBarStartScrollX = (int) mUrlBar.getLayout().getPrimaryHorizontal(0);
- urlBarStartScrollX -= mUrlBar.getWidth();
- }
+ // The call to getLayout() can return null briefly during text changes, but as it
+ // is only needed for RTL calculations, we proceed if the location bar is showing
+ // LTR content.
+ boolean isLocationBarRtl = ApiCompatibilityUtils.isLayoutRtl(mPhoneLocationBar);
+ if (!isLocationBarRtl || mUrlBar.getLayout() != null) {
+ int urlBarStartScrollX = 0;
+ if (isLocationBarRtl) {
+ urlBarStartScrollX = (int) mUrlBar.getLayout().getPrimaryHorizontal(0);
+ urlBarStartScrollX -= mUrlBar.getWidth();
+ }
- // If the scroll position matches the current scroll position, do not trigger
- // this animation as it will cause visible jumps when going from cleared text
- // back to page URLs (despite it continually calling setScrollX with the same
- // number).
- if (mUrlBar.getScrollX() != urlBarStartScrollX) {
- animator = ObjectAnimator.ofInt(
- mUrlBar,
- buildUrlScrollProperty(mPhoneLocationBar, isLocationBarRtl),
- urlBarStartScrollX);
- animator.setDuration(URL_FOCUS_CHANGE_ANIMATION_DURATION_MS);
- animator.setInterpolator(BakedBezierInterpolator.TRANSFORM_CURVE);
- animators.add(animator);
- }
+ // If the scroll position matches the current scroll position, do not trigger
+ // this animation as it will cause visible jumps when going from cleared text
+ // back to page URLs (despite it continually calling setScrollX with the same
+ // number).
+ if (mUrlBar.getScrollX() != urlBarStartScrollX) {
+ animator = ObjectAnimator.ofInt(
+ mUrlBar,
+ buildUrlScrollProperty(mPhoneLocationBar, isLocationBarRtl),
+ urlBarStartScrollX);
+ animator.setDuration(URL_FOCUS_CHANGE_ANIMATION_DURATION_MS);
+ animator.setInterpolator(BakedBezierInterpolator.TRANSFORM_CURVE);
+ animators.add(animator);
}
}
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarModel.java ('k') | chrome/android/java_sources.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698