From b5d850c85c4ac8fde8917c6c54396696515bb87f Mon Sep 17 00:00:00 2001 From: Joemer Ramos Date: Thu, 9 Mar 2023 11:00:30 +0000 Subject: [PATCH] [iOS] Reverting contentInset change in Price Tracking 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 Reviewed-by: Gauthier Ambard Auto-Submit: Joemer Ramos Cr-Commit-Position: refs/heads/main@{#1115048} --- .../cells/price_notifications_track_button.mm | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/ios/chrome/browser/ui/price_notifications/cells/price_notifications_track_button.mm b/ios/chrome/browser/ui/price_notifications/cells/price_notifications_track_button.mm index ec756f6aed6ccb..2268dd4b73ab57 100644 --- a/ios/chrome/browser/ui/price_notifications/cells/price_notifications_track_button.mm +++ b/ios/chrome/browser/ui/price_notifications/cells/price_notifications_track_button.mm @@ -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(