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

87 lines
4.4 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 | 18 +-----------------
.../searchbox/searchbox_handler.cc | 2 ++
components/search/ntp_features.cc | 4 ++--
4 files changed, 6 insertions(+), 20 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
@@ -2079,7 +2079,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
registry->RegisterBooleanPref(prefs::kDisableScreenshots, false);
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
@@ -43,23 +43,7 @@ import {SubmitButtonIconType} from '//resources/cr_components/composebox/compose
<div id="searchboxContainer"
@focusin="${this.onSearchboxContainerFocusin_}"
@focusout="${this.onSearchboxContainerFocusout_}">
- <ntp-searchbox id="searchbox" ?is-dark="${this.isThemeDark_()}"
- placeholder-text="$i18n{searchBoxPlaceholder}"
- ?color-source-is-baseline="${this.colorSourceIsBaseline}"
- @open-composebox="${this.onOpenComposebox_}"
- @open-lens-search="${this.onOpenLensSearch_}"
- @open-voice-search="${this.onOpenVoiceSearch_}" ?shown="${this.realboxShown_}"
- ?had-secondary-side="${this.realboxHadSecondarySide}"
- @had-secondary-side-changed="${this.onRealboxHadSecondarySideChanged_}"
- ?can-show-secondary-side="${this.realboxCanShowSecondarySide}"
- ?compose-button-enabled="${this.composeButtonEnabled}"
- ?composebox-enabled="${this.composeboxEnabled}"
- searchbox-layout-mode="${this.ntpRealboxNextEnabled_ ? 'Compact' : ''}"
- ?ntp-realbox-next-enabled="${this.ntpRealboxNextEnabled_}"
- ?cycling-placeholders="${this.searchboxCyclingPlaceholders_}"
- context-menu-glif-animation-state="${this.contextMenuGlifAnimationState_}"
- ?multi-line-enabled="${this.multiLineEnabled_}">
- </ntp-searchbox>
+ <div id="searchbox"></div>
${this.showComposebox_ ? html`
<div id="dialogAnchor"></div>
<dialog id="composeboxDialog">
diff --git a/chrome/browser/ui/webui/cr_components/searchbox/searchbox_handler.cc b/chrome/browser/ui/webui/cr_components/searchbox/searchbox_handler.cc
--- a/chrome/browser/ui/webui/cr_components/searchbox/searchbox_handler.cc
+++ b/chrome/browser/ui/webui/cr_components/searchbox/searchbox_handler.cc
@@ -321,6 +321,8 @@ base::DictValue SearchboxHandler::GetWebUIDataSourceDict(Profile* profile) {
base::DictValue SearchboxHandler::GetWebUIDataSourceDict(
Profile* profile,
WebUIDataSourceOptions options) {
+ options.enable_lens_search = false;
+ options.enable_voice_search = false;
base::DictValue dict;
// The WebUI Omnibox code will override this to `true` to adjust various
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
@@ -97,7 +97,7 @@ BASE_FEATURE(kNtpDriveModuleSegmentation, base::FEATURE_DISABLED_BY_DEFAULT);
// If enabled, logo will be shown.
// This is a kill switch. Keep indefinitely.
-BASE_FEATURE(kNtpLogo, base::FEATURE_ENABLED_BY_DEFAULT);
+BASE_FEATURE(kNtpLogo, base::FEATURE_DISABLED_BY_DEFAULT);
// If enabled, middle slot promo will be shown.
// This is a kill switch. Keep indefinitely.
@@ -139,7 +139,7 @@ BASE_FEATURE(kNtpModuleSignInRequirement, base::FEATURE_ENABLED_BY_DEFAULT);
// If enabled, OneGoogleBar will be shown.
// This is a kill switch. Keep indefinitely.
-BASE_FEATURE(kNtpOneGoogleBar, base::FEATURE_ENABLED_BY_DEFAULT);
+BASE_FEATURE(kNtpOneGoogleBar, base::FEATURE_DISABLED_BY_DEFAULT);
// If enabled, outlook calendar module will be shown.
BASE_FEATURE(kNtpOutlookCalendarModule, base::FEATURE_ENABLED_BY_DEFAULT);
--