Created enterprise policy for gemini integration

Bug: 383130613
Change-Id: Ib5eca0a01a087dbdb928dff8f1d86ee2e3b9a909
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6112295
Reviewed-by: Owen Min <[email protected]>
Reviewed-by: David Trainor <[email protected]>
Commit-Queue: Salvador Guerrero Ramos <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1419406}
diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
index da54f6c..2e1dccb 100644
--- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc
+++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
@@ -437,6 +437,9 @@
   { key::kSharedWorkerBlobURLFixEnabled,
     prefs::kSharedWorkerBlobURLFixEnabled,
     base::Value::Type::BOOLEAN},
+  { key::kGeminiSettings,
+    prefs::kGeminiSettings,
+    base::Value::Type::INTEGER },
 // Policies for all platforms - End
 #if BUILDFLAG(IS_ANDROID)
   { key::kAccessibilityPerformanceFilteringAllowed,
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 745c2ce..3cb574ce 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -1940,6 +1940,7 @@
   PushMessagingAppIdentifier::RegisterProfilePrefs(registry);
   QuietNotificationPermissionUiState::RegisterProfilePrefs(registry);
   RegisterBrowserUserPrefs(registry);
+  RegisterGeminiSettingsPrefs(registry);
   RegisterPrefersDefaultScrollbarStylesPrefs(registry);
   RegisterSafetyHubProfilePrefs(registry);
 #if BUILDFLAG(IS_CHROMEOS_ASH)
@@ -2328,6 +2329,10 @@
   registry->RegisterBooleanPref(prefs::kDisableScreenshots, false);
 }
 
+void RegisterGeminiSettingsPrefs(user_prefs::PrefRegistrySyncable* registry) {
+  registry->RegisterIntegerPref(prefs::kGeminiSettings, 0);
+}
+
 #if BUILDFLAG(IS_CHROMEOS_ASH)
 void RegisterSigninProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
                                 std::string_view country) {
diff --git a/chrome/browser/prefs/browser_prefs.h b/chrome/browser/prefs/browser_prefs.h
index f2c2a128..493aff6 100644
--- a/chrome/browser/prefs/browser_prefs.h
+++ b/chrome/browser/prefs/browser_prefs.h
@@ -31,6 +31,8 @@
 
 void RegisterScreenshotPrefs(PrefRegistrySimple* registry);
 
+void RegisterGeminiSettingsPrefs(user_prefs::PrefRegistrySyncable* registry);
+
 // Register all prefs that will be used via a PrefService attached to a user
 // Profile using the locale of |g_browser_process|.
 void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
index 32141931..d42819c 100644
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -1326,6 +1326,10 @@
 // toolbar.
 inline constexpr char kShowForwardButton[] = "browser.show_forward_button";
 
+// A boolean pref set to true if Gemini integration be enabled. This is managed
+// by enterprise policy.
+inline constexpr char kGeminiSettings[] = "browser.gemini_settings";
+
 // Comma separated list of domain names (e.g. "google.com,school.edu").
 // When this pref is set, the user will be able to access Google Apps
 // only using an account that belongs to one of the domains from this pref.