[iOS][Default Promo] Fix 'iOS' capitalization issue

Bug: 1201696
Change-Id: I500786efd2f93005b0cabe64752ddc3c92eef1cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2846865
Reviewed-by: Robbie Gibson <rkgibson@google.com>
Commit-Queue: Javier Flores <javierrobles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#875253}
GitOrigin-RevId: a98a72293fce8c4fd76f91f01fa475bab836e9a3
diff --git a/chrome/browser/ui/default_promo/tailored_promo_view_controller.mm b/chrome/browser/ui/default_promo/tailored_promo_view_controller.mm
index f8b8bf3..0ee37b5 100644
--- a/chrome/browser/ui/default_promo/tailored_promo_view_controller.mm
+++ b/chrome/browser/ui/default_promo/tailored_promo_view_controller.mm
@@ -27,6 +27,7 @@
   self.secondaryActionAvailable = YES;
   self.showDismissBarButton = NO;
   self.dismissBarButtonSystemItem = UIBarButtonSystemItemCancel;
+  self.capitalizeTitle = NO;
   if (@available(iOS 13.4, *)) {
     self.pointerInteractionEnabled = YES;
   }
diff --git a/chrome/common/ui/confirmation_alert/confirmation_alert_view_controller.h b/chrome/common/ui/confirmation_alert/confirmation_alert_view_controller.h
index 2c7f656..b69f595 100644
--- a/chrome/common/ui/confirmation_alert/confirmation_alert_view_controller.h
+++ b/chrome/common/ui/confirmation_alert/confirmation_alert_view_controller.h
@@ -34,6 +34,9 @@
 // Text style for the title. If nil, will default to UIFontTextStyleTitle1.
 @property(nonatomic, copy) NSString* titleTextStyle;
 
+// Whether to capitalize or not the title string. Defaults to YES.
+@property(nonatomic, assign) BOOL capitalizeTitle;
+
 // The subtitle below the title. Must be set before the view is loaded.
 @property(nonatomic, copy) NSString* subtitleString;
 
diff --git a/chrome/common/ui/confirmation_alert/confirmation_alert_view_controller.mm b/chrome/common/ui/confirmation_alert/confirmation_alert_view_controller.mm
index 0338ae6..7108cc1 100644
--- a/chrome/common/ui/confirmation_alert/confirmation_alert_view_controller.mm
+++ b/chrome/common/ui/confirmation_alert/confirmation_alert_view_controller.mm
@@ -80,6 +80,7 @@
     _customSpacingAfterImage = kStackViewSpacingAfterIllustration;
     _showDismissBarButton = YES;
     _dismissBarButtonSystemItem = UIBarButtonSystemItemDone;
+    _capitalizeTitle = YES;
   }
   return self;
 }
@@ -483,7 +484,11 @@
       [UIFontMetrics metricsForTextStyle:self.titleTextStyle];
   title.font = [fontMetrics scaledFontForFont:font];
   title.textColor = [UIColor colorNamed:kTextPrimaryColor];
-  title.text = self.titleString.capitalizedString;
+  if (self.capitalizeTitle) {
+    title.text = self.titleString.capitalizedString;
+  } else {
+    title.text = self.titleString;
+  }
   title.textAlignment = NSTextAlignmentCenter;
   title.translatesAutoresizingMaskIntoConstraints = NO;
   title.adjustsFontForContentSizeCategory = YES;