Files
cromite/build/patches/Disable-Real-Box.patch
T
2024-03-27 15:56:10 +00:00

76 lines
3.3 KiB
Diff

From: uazo <uazo@users.noreply.github.com>
Date: Sun, 5 Nov 2023 17:59:54 +0000
Subject: Disable Real Box
Real-box is search box in ntp
---
chrome/browser/prefs/browser_prefs.cc | 2 +-
chrome/browser/resources/new_tab_page/app.html | 5 -----
chrome/browser/ui/webui/realbox/realbox_handler.cc | 2 +-
components/search/ntp_features.cc | 6 +++---
4 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -2072,7 +2072,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
registry->RegisterBooleanPref(
prefs::kLensRegionSearchEnabled, true,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kLensDesktopNTPSearchEnabled, true);
+ registry->RegisterBooleanPref(prefs::kLensDesktopNTPSearchEnabled, false);
#endif
#if !BUILDFLAG(IS_ANDROID)
diff --git a/chrome/browser/resources/new_tab_page/app.html b/chrome/browser/resources/new_tab_page/app.html
--- a/chrome/browser/resources/new_tab_page/app.html
+++ b/chrome/browser/resources/new_tab_page/app.html
@@ -504,11 +504,6 @@
hidden$="[[!logoEnabled_]]">
</ntp-logo>
<div id="realboxContainer">
- <ntp-realbox id="realbox" is-dark="[[theme_.isDark]]"
- color-source-is-baseline="[[colorSourceIsBaseline]]"
- on-open-lens-search="onOpenLensSearch_"
- on-open-voice-search="onOpenVoiceSearch_" shown$="[[realboxShown_]]">
- </ntp-realbox>
<template is="dom-if" if="[[showLensUploadDialog_]]" restamp>
<ntp-lens-upload-dialog id="lensUploadDialog"
on-close-lens-search="onCloseLensSearch_">
diff --git a/chrome/browser/ui/webui/realbox/realbox_handler.cc b/chrome/browser/ui/webui/realbox/realbox_handler.cc
--- a/chrome/browser/ui/webui/realbox/realbox_handler.cc
+++ b/chrome/browser/ui/webui/realbox/realbox_handler.cc
@@ -672,7 +672,7 @@ void RealboxHandler::SetupWebUIDataSource(content::WebUIDataSource* source,
source->AddBoolean(
"realboxLensSearch",
- profile->GetPrefs()->GetBoolean(prefs::kLensDesktopNTPSearchEnabled));
+ false);
source->AddString("realboxLensVariations", GetBase64UrlVariations(profile));
source->AddBoolean(
"realboxLensDirectUpload",
diff --git a/components/search/ntp_features.cc b/components/search/ntp_features.cc
--- a/components/search/ntp_features.cc
+++ b/components/search/ntp_features.cc
@@ -171,7 +171,7 @@ BASE_FEATURE(kNtpHandleMostVisitedNavigationExplicitly,
base::FEATURE_ENABLED_BY_DEFAULT);
// If enabled, logo will be shown.
-BASE_FEATURE(kNtpLogo, "NtpLogo", base::FEATURE_ENABLED_BY_DEFAULT);
+BASE_FEATURE(kNtpLogo, "NtpLogo", base::FEATURE_DISABLED_BY_DEFAULT);
// If enabled, logo will fill up less vertical space.
BASE_FEATURE(kNtpReducedLogoSpace,
@@ -248,8 +248,8 @@ BASE_FEATURE(kNtpMostVisitedReflowOnOverflow,
// If enabled, OneGoogleBar will be shown.
BASE_FEATURE(kNtpOneGoogleBar,
- "NtpOneGoogleBar",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ "NtpOneGoogleBar", // disabled
+ base::FEATURE_DISABLED_BY_DEFAULT); // by default
// If enabled, Google Photos module will be shown.
BASE_FEATURE(kNtpPhotosModule,
--