Files
cromite/build/patches/Disable-Real-Box.patch
T

77 lines
3.7 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 | 7 -------
chrome/browser/ui/webui/searchbox/searchbox_handler.cc | 1 +
components/search/ntp_features.cc | 6 +++---
4 files changed, 5 insertions(+), 11 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
@@ -2135,7 +2135,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
@@ -429,13 +429,6 @@
hidden$="[[!logoEnabled_]]">
</ntp-logo>
<div id="realboxContainer">
- <cr-realbox id="realbox" is-dark="[[theme_.isDark]]"
- color-source-is-baseline="[[colorSourceIsBaseline]]"
- on-open-lens-search="onOpenLensSearch_"
- on-open-voice-search="onOpenVoiceSearch_" shown$="[[realboxShown_]]"
- had-secondary-side="{{realboxHadSecondarySide}}"
- can-show-secondary-side="[[realboxCanShowSecondarySide]]">
- </cr-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/searchbox/searchbox_handler.cc b/chrome/browser/ui/webui/searchbox/searchbox_handler.cc
--- a/chrome/browser/ui/webui/searchbox/searchbox_handler.cc
+++ b/chrome/browser/ui/webui/searchbox/searchbox_handler.cc
@@ -457,6 +457,7 @@ void SearchboxHandler::SetupWebUIDataSource(content::WebUIDataSource* source,
Profile* profile,
bool enable_voice_search,
bool enable_lens_search) {
+ enable_lens_search = false;
// Embedders which are served from chrome-untrusted:// URLs should override
// this to false. The chrome.timeTicks capability that the metrics reporter
// depends on is not defined in chrome-untrusted environments and attempting
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
@@ -169,7 +169,7 @@ BASE_FEATURE(kNtpHandleMostVisitedNavigationExplicitly,
// If enabled, logo will be shown.
// This is a kill switch. Keep indefinitely.
-BASE_FEATURE(kNtpLogo, "NtpLogo", base::FEATURE_ENABLED_BY_DEFAULT);
+BASE_FEATURE(kNtpLogo, "NtpLogo", base::FEATURE_DISABLED_BY_DEFAULT);
// If enabled, middle slot promo will be shown.
// This is a kill switch. Keep indefinitely.
@@ -237,8 +237,8 @@ BASE_FEATURE(kNtpModulesRedesigned,
// If enabled, OneGoogleBar will be shown.
// This is a kill switch. Keep indefinitely.
BASE_FEATURE(kNtpOneGoogleBar,
- "NtpOneGoogleBar",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ "NtpOneGoogleBar", // disabled
+ base::FEATURE_DISABLED_BY_DEFAULT); // by default
// If enabled, outlook calendar module will be shown.
BASE_FEATURE(kNtpOutlookCalendarModule,
--