[iOS][evolve-disco-header] Add padding on the top of NTP selectively

This CL shifts contents in NTP downwards, except the the user's avatar
and the home customization button for iPhone users who are enrolled in
the experiment to remove the Discover / Following header.

iPhone only; tablet not affected.

Bug: 359325090
Change-Id: I1aa91271dd99e3f3a6315aa33ccb0b64aae5d6a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6225887
Commit-Queue: Ginny Huang <ginnyhuang@chromium.org>
Auto-Submit: Ginny Huang <ginnyhuang@chromium.org>
Reviewed-by: Chris Lu <thegreenfrog@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1416190}
NOKEYCHECK=True
GitOrigin-RevId: 5d79fac57bc5815dbb7f02f685773a11148d208c
diff --git a/chrome/browser/flags/about_flags.mm b/chrome/browser/flags/about_flags.mm
index 2fb74da..a86b7bf 100644
--- a/chrome/browser/flags/about_flags.mm
+++ b/chrome/browser/flags/about_flags.mm
@@ -1253,11 +1253,11 @@
 const FeatureEntry::FeatureParam
     kDeprecateFeedHeaderVariationAbovePlusAddTopPadding[] = {
         {kDeprecateFeedHeaderParameterRemoveLabel, "true"},
-        {kDeprecateFeedHeaderParameterTopPadding, "true"}};
+        {kDeprecateFeedHeaderParameterTopPadding, "34"}};
 const FeatureEntry::FeatureParam
     kDeprecateFeedHeaderVariationAbovePlusEnlargeElements[] = {
         {kDeprecateFeedHeaderParameterRemoveLabel, "true"},
-        {kDeprecateFeedHeaderParameterTopPadding, "true"},
+        {kDeprecateFeedHeaderParameterTopPadding, "34"},
         {kDeprecateFeedHeaderParameterEnlargeLogoAndFakebox, "true"}};
 
 const FeatureEntry::FeatureVariation kDeprecateFeedHeaderVariations[] = {
diff --git a/chrome/browser/ntp/ui_bundled/new_tab_page_feature.h b/chrome/browser/ntp/ui_bundled/new_tab_page_feature.h
index df63dc0..6ef7216 100644
--- a/chrome/browser/ntp/ui_bundled/new_tab_page_feature.h
+++ b/chrome/browser/ntp/ui_bundled/new_tab_page_feature.h
@@ -106,7 +106,10 @@
 
 // YES if the NTP and feed header elements should be re-positioned as described.
 bool ShouldRemoveDiscoverLabel(bool is_google_default_search_engine);
-bool ShouldAddTopPaddingToNTP();
 bool ShouldEnlargeLogoAndFakebox();
 
+// Top padding that should be added to the top of the NTP. Returns 0 if the NTP
+// should not be padded.
+double TopPaddingToNTP();
+
 #endif  // IOS_CHROME_BROWSER_NTP_UI_BUNDLED_NEW_TAB_PAGE_FEATURE_H_
diff --git a/chrome/browser/ntp/ui_bundled/new_tab_page_feature.mm b/chrome/browser/ntp/ui_bundled/new_tab_page_feature.mm
index 2f0d6c8..2d14d83 100644
--- a/chrome/browser/ntp/ui_bundled/new_tab_page_feature.mm
+++ b/chrome/browser/ntp/ui_bundled/new_tab_page_feature.mm
@@ -113,13 +113,13 @@
              false);
 }
 
-bool ShouldAddTopPaddingToNTP() {
-  return base::GetFieldTrialParamByFeatureAsBool(
-      kDeprecateFeedHeader, kDeprecateFeedHeaderParameterTopPadding, false);
-}
-
 bool ShouldEnlargeLogoAndFakebox() {
   return base::GetFieldTrialParamByFeatureAsBool(
       kDeprecateFeedHeader, kDeprecateFeedHeaderParameterEnlargeLogoAndFakebox,
       false);
 }
+
+double TopPaddingToNTP() {
+  return base::GetFieldTrialParamByFeatureAsDouble(
+      kDeprecateFeedHeader, kDeprecateFeedHeaderParameterTopPadding, 0);
+}
diff --git a/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.mm b/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.mm
index 165a49e..5180a1e 100644
--- a/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.mm
+++ b/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.mm
@@ -7,6 +7,7 @@
 #import "base/i18n/rtl.h"
 #import "components/strings/grit/components_strings.h"
 #import "ios/chrome/browser/location_bar/ui_bundled/location_bar_constants.h"
+#import "ios/chrome/browser/ntp/ui_bundled/new_tab_page_feature.h"
 #import "ios/chrome/browser/ntp/ui_bundled/new_tab_page_header_constants.h"
 #import "ios/chrome/browser/shared/public/features/features.h"
 #import "ios/chrome/browser/shared/ui/elements/new_feature_badge_view.h"
@@ -149,6 +150,7 @@
   // If Magic Stack is not enabled, this value is zero (e.g. no-op).
   top_margin -= ReducedNTPTopMarginSpaceForMagicStack();
   top_margin += kDoodleTopMarginOther;
+  top_margin += TopPaddingToNTP();
   return top_margin;
 }