Remove the SODA component from non-SODA builds

This CL removes the registration of the SODA component for builds with
the enable_soda build flag disabled.

Bug: 1110086
Change-Id: I9b55fde2de20ca24909fcc8bca5de65141128ab6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2321516
Reviewed-by: Joshua Pawlicki <[email protected]>
Commit-Queue: Evan Liu <[email protected]>
Cr-Commit-Position: refs/heads/master@{#792298}
diff --git a/chrome/browser/component_updater/soda_component_installer.cc b/chrome/browser/component_updater/soda_component_installer.cc
index 6abf4435..57557c6 100644
--- a/chrome/browser/component_updater/soda_component_installer.cc
+++ b/chrome/browser/component_updater/soda_component_installer.cc
@@ -9,6 +9,7 @@
 #include "build/build_config.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/common/pref_names.h"
+#include "chrome/services/speech/buildflags.h"
 #include "components/component_updater/component_updater_service.h"
 #include "components/crx_file/id_util.h"
 #include "components/soda/constants.h"
@@ -130,7 +131,7 @@
                            PrefService* prefs,
                            base::OnceClosure callback) {
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
-
+#if BUILDFLAG(ENABLE_SODA)
   auto installer = base::MakeRefCounted<ComponentInstaller>(
       std::make_unique<SODAComponentInstallerPolicy>(base::BindRepeating(
           [](ComponentUpdateService* cus, PrefService* prefs,
@@ -161,6 +162,7 @@
               cus, prefs));
     }
   }
+#endif
 }
 
 bool UninstallSODAComponent(ComponentUpdateService* cus, PrefService* prefs) {