[iOS] Fix spacing between grid cell title and close button.

This Cl fixes the spacing between the grid cell title and the close
button. When setting a constant offset for a trailing anchor, a positive
constant results in the trailing anchor being further in the trailing
direction, so a negative constant is needed to ensure the trailing anchor is on
the leading side of the anchor it is constrained to.

Per UX, the offset between the label and the button is set to 4 points.

Bug: 862343
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I01fc0e927c281ea5b174af4126c7e44fd3fc4f7f
Reviewed-on: https://chromium-review.googlesource.com/1140316
Reviewed-by: edchin <edchin@chromium.org>
Commit-Queue: edchin <edchin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576145}
diff --git a/ios/chrome/browser/ui/tab_grid/grid/grid_cell.mm b/ios/chrome/browser/ui/tab_grid/grid/grid_cell.mm
index 5d148b1..eb8d5c4 100644
--- a/ios/chrome/browser/ui/tab_grid/grid/grid_cell.mm
+++ b/ios/chrome/browser/ui/tab_grid/grid/grid_cell.mm
@@ -260,7 +260,7 @@
     [titleLabel.centerYAnchor constraintEqualToAnchor:topBar.centerYAnchor],
     [titleLabel.trailingAnchor
         constraintLessThanOrEqualToAnchor:closeIconView.leadingAnchor
-                                 constant:kGridCellCloseButtonContentInset],
+                                 constant:-kGridCellTitleLabelContentInset],
     [closeIconView.topAnchor constraintEqualToAnchor:topBar.topAnchor],
     [closeIconView.bottomAnchor constraintEqualToAnchor:topBar.bottomAnchor],
     [closeIconView.trailingAnchor
diff --git a/ios/chrome/browser/ui/tab_grid/grid/grid_constants.h b/ios/chrome/browser/ui/tab_grid/grid/grid_constants.h
index 8a9dda23..7177735 100644
--- a/ios/chrome/browser/ui/tab_grid/grid/grid_constants.h
+++ b/ios/chrome/browser/ui/tab_grid/grid/grid_constants.h
@@ -74,6 +74,7 @@
 extern const CGFloat kGridCellHeaderLeadingInset;
 extern const CGFloat kGridCellCloseTapTargetWidthHeight;
 extern const CGFloat kGridCellCloseButtonContentInset;
+extern const CGFloat kGridCellTitleLabelContentInset;
 extern const CGFloat kGridCellIconDiameter;
 extern const CGFloat kGridCellSelectionRingGapWidth;
 extern const CGFloat kGridCellSelectionRingTintWidth;
diff --git a/ios/chrome/browser/ui/tab_grid/grid/grid_constants.mm b/ios/chrome/browser/ui/tab_grid/grid/grid_constants.mm
index b6508d7..b81b7df 100644
--- a/ios/chrome/browser/ui/tab_grid/grid/grid_constants.mm
+++ b/ios/chrome/browser/ui/tab_grid/grid/grid_constants.mm
@@ -71,6 +71,7 @@
 const CGFloat kGridCellHeaderLeadingInset = 5.0f;
 const CGFloat kGridCellCloseTapTargetWidthHeight = 44.0f;
 const CGFloat kGridCellCloseButtonContentInset = 8.5f;
+const CGFloat kGridCellTitleLabelContentInset = 4.0f;
 const CGFloat kGridCellIconDiameter = 22.0f;
 const CGFloat kGridCellSelectionRingGapWidth = 2.0f;
 const CGFloat kGridCellSelectionRingTintWidth = 5.0f;