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

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

Issue 2510313003: Fix location bar jump when focusing/unfocusing on phones. (Closed)
Patch Set: Fix comment grammar mistakes Created 4 years, 1 month 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/LocationBarLayout.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java
index df79197cc752f8ba411a6e7db8b7f1b2b0b0d546..2becb2b60aba4be82952d08c67c946c6d10e7807 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java
@@ -887,9 +887,11 @@ public class LocationBarLayout extends FrameLayout implements OnClickListener,
boolean isOffline = getCurrentTab() != null && getCurrentTab().isOfflinePage();
boolean isTablet = DeviceFormFactor.isTablet(getContext());
- if (mUrlHasFocus) {
- return isTablet ? BUTTON_TYPE_NAVIGATION_ICON : BUTTON_TYPE_NONE;
- }
+ // The navigation icon type is only applicable on tablets. While smaller form factors do
+ // not have an icon visible to the user when the URL is focused, BUTTON_TYPE_NONE is not
+ // returned as it will trigger an undesired jump during the animation as it attempts to
+ // hide the icon.
+ if (mUrlHasFocus && isTablet) return BUTTON_TYPE_NAVIGATION_ICON;
return getSecurityIconResource(getSecurityLevel(), !isTablet, isOffline) != 0
? BUTTON_TYPE_SECURITY_ICON
« 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