Skip to content

Commit

Permalink
[iOS] Reverting contentInset change in Price Tracking
Browse files Browse the repository at this point in the history
Using UIButtonConfiguration is crashing Price Tracking feature. This
CL reverts that change for now to avoid crashes while we look for a
long term fix.

Fixed: 1422402, 1422335
Change-Id: I3f46d31f4fe325f34df7c00cfa543f6ea9c275fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4321409
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Reviewed-by: Gauthier Ambard <gambard@chromium.org>
Auto-Submit: Joemer Ramos <joemerramos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1115048}
  • Loading branch information
Joemer Ramos authored and Chromium LUCI CQ committed Mar 9, 2023
1 parent 5291dab commit b5d850c
Showing 1 changed file with 3 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,9 @@ - (void)layoutSubviews {
price_notifications::CalculateTrackButtonHorizontalPadding(
self.superview.superview.frame.size.width,
self.titleLabel.intrinsicContentSize.width);

// TODO(crbug.com/1418068): Simplify after minimum version required is >=
// iOS 15.
if (@available(iOS 15, *)) {
UIButtonConfiguration* buttonConfiguration =
[UIButtonConfiguration plainButtonConfiguration];
buttonConfiguration.contentInsets =
NSDirectionalEdgeInsetsMake(kTrackButtonTopPadding, horizontalPadding,
kTrackButtonTopPadding, horizontalPadding);
self.configuration = buttonConfiguration;
}
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_15_0
else {
self.contentEdgeInsets =
UIEdgeInsetsMake(kTrackButtonTopPadding, horizontalPadding,
kTrackButtonTopPadding, horizontalPadding);
}
#endif // __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_15_0
self.contentEdgeInsets =
UIEdgeInsetsMake(kTrackButtonTopPadding, horizontalPadding,
kTrackButtonTopPadding, horizontalPadding);

price_notifications::WidthConstraintValues constraintValues =
price_notifications::CalculateTrackButtonWidthConstraints(
Expand Down

0 comments on commit b5d850c

Please sign in to comment.