Skip to content

Commit

Permalink
Merge pull request #15574 from brave/android_url_bar_long_links
Browse files Browse the repository at this point in the history
Makes eTLD+1 always visible on Android
  • Loading branch information
SergeyZhukovsky authored Oct 20, 2022
2 parents 1106b18 + c4d2a1e commit 2529b3b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1103,26 +1103,6 @@ public void updateModernLocationBarColorImpl(int color) {
}
}

@Override
public int getBoundsAfterAccountingForRightButtonsImpl(ViewGroup toolbarButtonsContainer) {
if (toolbarButtonsContainer == null || mShieldsLayout == null) {
assert false;
return 0;
}
ViewGroup.MarginLayoutParams params =
(ViewGroup.MarginLayoutParams) toolbarButtonsContainer.getLayoutParams();

int rewardsLen = (mRewardsLayout == null || mRewardsLayout.getVisibility() == View.GONE)
? 0
: mRewardsLayout.getWidth();
int walletLen = (mWalletLayout == null || mWalletLayout.getVisibility() == View.GONE)
? 0
: mWalletLayout.getWidth();

return toolbarButtonsContainer.getMeasuredWidth() - mShieldsLayout.getWidth() - rewardsLen
- walletLen + params.getMarginEnd();
}

/**
* If |tab| is null, set disabled image to shields button and |urlString| is
* ignored.
Expand Down Expand Up @@ -1353,8 +1333,7 @@ && getMenuButtonCoordinator() != null) {
}

private void updateShieldsLayoutBackground(boolean rounded) {
if (!BraveReflectionUtil.EqualTypes(this.getClass(), ToolbarTablet.class)
|| (mShieldsLayout == null)) {
if (mShieldsLayout == null) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ public interface BraveToolbarLayout {

public void updateModernLocationBarColorImpl(int color);

public int getBoundsAfterAccountingForRightButtonsImpl(ViewGroup toolbarButtonsContainer);

public void populateUrlAnimatorSetImpl(boolean showExpandedState,
int urlFocusToolbarButtonsDuration, int urlClearFocusTabStackDelayMs,
List<Animator> animators);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java
index eb864a7eaa7ee2f367904d74a26d3dd9405bffd1..d5afa354c14afb3ffc83440a8bf8ecac35a8d34e 100644
index eb864a7eaa7ee2f367904d74a26d3dd9405bffd1..2b9a24df8a72d90baf06cc2e5972b6481d7d9147 100644
--- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java
+++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java
@@ -377,6 +377,7 @@ public class ToolbarPhone extends ToolbarLayout implements OnClickListener, TabC
Expand All @@ -18,23 +18,15 @@ index eb864a7eaa7ee2f367904d74a26d3dd9405bffd1..d5afa354c14afb3ffc83440a8bf8ecac
}

@Override
@@ -734,6 +736,7 @@ public class ToolbarPhone extends ToolbarLayout implements OnClickListener, TabC
* @return The right bounds of the location bar after accounting for any visible right buttons.
*/
private int getBoundsAfterAccountingForRightButtons() {
+ if (true) return Math.max(mToolbarSidePadding, BraveToolbarLayout.class.cast(this).getBoundsAfterAccountingForRightButtonsImpl(mToolbarButtonsContainer));
if (mStartSurfaceScrollFraction == 1.0f) return mToolbarSidePadding;

int toolbarButtonsContainerWidth = mToolbarButtonsContainer.getMeasuredWidth();
@@ -983,6 +986,7 @@ public class ToolbarPhone extends ToolbarLayout implements OnClickListener, TabC
@@ -983,6 +985,7 @@ public class ToolbarPhone extends ToolbarLayout implements OnClickListener, TabC
* New Tab Page.
*/
private void updateLocationBarLayoutForExpansionAnimation() {
+ if (!BraveToolbarLayout.class.cast(this).isLocationBarValid(mLocationBar)) return;
TraceEvent.begin("ToolbarPhone.updateLocationBarLayoutForExpansionAnimation");
if (mOptimizationsEnabled && isInTabSwitcherMode()) return;

@@ -1973,6 +1977,7 @@ public class ToolbarPhone extends ToolbarLayout implements OnClickListener, TabC
@@ -1973,6 +1976,7 @@ public class ToolbarPhone extends ToolbarLayout implements OnClickListener, TabC
} else {
populateUrlClearExpansionAnimatorSet(animators);
}
Expand Down

0 comments on commit 2529b3b

Please sign in to comment.