From 8d85dbe5fb431319d78e994aec7e7b9afc60fabe Mon Sep 17 00:00:00 2001
From: Muhammad Salmaan <musalmaan@chromium.org>
Date: Wed, 7 May 2025 06:50:24 -0700
Subject: [PATCH] Add Chrome branded control flow for tests and remove
 installer strings

Added the chrome branded conditional statement to make sure the test
runs with chrome strings and this will remove the need for having
chromium strings. They are being removed in this cl.

Bug: 412697757
Change-Id: Ie84ce6b082bad52d4bc3ab6c7fd5232f620a3072
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6513545
Reviewed-by: Kaan Alsan <alsan@chromium.org>
Commit-Queue: Muhammad Salmaan <musalmaan@chromium.org>
Reviewed-by: Ian Clelland <iclelland@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1456963}
---
 chrome/app/chromium_strings.grd | 11 -----------
 chrome/browser/ui/BUILD.gn      |  2 +-
 chrome/test/BUILD.gn            |  2 +-
 3 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/chrome/app/chromium_strings.grd b/chrome/app/chromium_strings.grd
index 28c343d7a73f5..7868e98e39f9e 100644
--- a/chrome/app/chromium_strings.grd
+++ b/chrome/app/chromium_strings.grd
@@ -1013,17 +1013,6 @@ Chromium is unable to recover your settings.
         </message>
       </if>
 
-      <!-- Installer Downloader infobar -->
-      <message name="IDS_INSTALLER_DOWNLOADER_DISCLAIMER" desc=" Installer downloader infobar message for downloading the Chromium installer." translateable="false">
-        Download the Chromium Installer.
-      </message>
-      <message name="IDS_INSTALLER_DOWNLOADER_LINK_TEXT" desc="Link text for the installer downloader infobar, 'Learn More'."  translateable="false">
-        Learn More
-      </message>
-      <message name="IDS_INSTALLER_DOWNLOADER_BUTTON_LABEL" desc="Button label for the installer downloader infobar to download the Chromium installer."  translateable="false">
-        Download Chromium Installer
-      </message>
-
       <!-- Enterprise sign-in dialog -->
       <message name="IDS_ENTERPRISE_VALUE_PROPOSITION_PROFILE_REQUIRED_BY_ORG_TITLE" desc="Title of the screen in the profile creation flow where the user is asked whether they want to confirm signing in to Chromium with their enterprise account when it is mandatory to sign in to Chromium with the enterprise account.">
         Your organization requires you to sign into Chromium
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
index 1c0780e3e72e5..903762386790f 100644
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -1970,7 +1970,7 @@ static_library("ui") {
       allow_circular_includes_from += [ "//chrome/browser/ui/find_bar:impl" ]
     }
 
-    if (is_win) {
+    if (is_win && is_chrome_branded) {
       sources += [
         "startup/installer_downloader/installer_downloader_infobar_delegate.cc",
         "startup/installer_downloader/installer_downloader_infobar_delegate.h",
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index 95782d9d007fe..a628365e1f0e8 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -7158,7 +7158,6 @@ test("unit_tests") {
       "../browser/task_manager/sampling/shared_sampler_win_unittest.cc",
       "../browser/tracing/windows_system_tracing_client_impl_unittest_win.cc",
       "../browser/ui/startup/credential_provider_signin_info_fetcher_win_unittest.cc",
-      "../browser/ui/startup/installer_downloader/installer_downloader_infobar_delegate_unittest.cc",
       "../browser/ui/views/frame/windows_caption_button_unittest.cc",
       "../browser/ui/views/uninstall_view_unittest.cc",
       "../browser/ui/webui/version/version_handler_win_unittest.cc",
@@ -7247,6 +7246,7 @@ test("unit_tests") {
     if (is_chrome_branded) {
       sources += [
         "../browser/component_updater/recovery_improved_component_unittest.cc",
+        "../browser/ui/startup/installer_downloader/installer_downloader_infobar_delegate_unittest.cc",
       ]
 
       data_deps +=