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

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

Issue 1226833010: Clean up custom tab toolbar ellisizing and animation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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/CustomTabToolbar.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java
index 8181d42e9ffcd575b5c9a2180d1ec2dc8e7eb74b..d9d8512290cdf6263d2af22900390e75bd87d2eb 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java
@@ -17,7 +17,6 @@ import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.text.TextUtils;
-import android.text.TextUtils.TruncateAt;
import android.util.AttributeSet;
import android.util.Pair;
import android.util.TypedValue;
@@ -370,7 +369,7 @@ public class CustomTabToolbar extends ToolbarLayout implements LocationBar {
if (securityLevel == ConnectionSecurityLevel.NONE) {
// TODO(yusufo): Add an animator for hiding as well.
mSecurityButton.setVisibility(GONE);
- } else {
+ } else if (mSecurityButton.getVisibility() != View.VISIBLE) {
if (mSecurityButtonShowAnimator.isRunning()) mSecurityButtonShowAnimator.cancel();
mSecurityButtonShowAnimator.start();
mUrlBar.deEmphasizeUrl();
@@ -472,27 +471,6 @@ public class CustomTabToolbar extends ToolbarLayout implements LocationBar {
return this;
}
- @Override
- protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
- if (changed) {
- final int availWidth = mUrlInfoContainer.getMeasuredWidth()
- - ApiCompatibilityUtils.getPaddingStart(mTitleBar)
- - ApiCompatibilityUtils.getPaddingEnd(mTitleBar);
- String currentText = mTitleBar.getText().toString();
- String currentTitle;
- Tab currentTab = getToolbarDataProvider().getTab();
- if (currentTab == null || TextUtils.isEmpty(currentTab.getTitle())) {
- currentTitle = "";
- } else {
- currentTitle = currentTab.getTitle();
- }
- String ellipsizedText = TextUtils.ellipsize(currentTitle,
- mTitleBar.getPaint(), availWidth, TruncateAt.END).toString();
- if (!ellipsizedText.equals(currentText)) mTitleBar.setText(ellipsizedText);
- }
- super.onLayout(changed, left, top, right, bottom);
- }
-
// Toolbar and LocationBar calls that are not relevant here.
@Override

Powered by Google App Engine
This is Rietveld 408576698