Files
helium/patches/extra/ungoogled-chromium/add-flag-for-tabsearch-button.patch

75 lines
3.1 KiB
Diff
Raw Normal View History

2021-07-23 13:47:10 -05:00
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
2025-11-20 11:54:19 -06:00
@@ -1644,7 +1644,8 @@ void BrowserCommandController::InitComma
2021-07-23 13:47:10 -05:00
command_updater_.UpdateCommandEnabled(IDC_WINDOW_CLOSE_OTHER_TABS,
normal_window);
- const bool enable_tab_search_commands = browser_->is_type_normal();
+ const bool enable_tab_search_commands = browser_->is_type_normal() &&
+ !base::CommandLine::ForCurrentProcess()->HasSwitch("remove-tabsearch-button");
command_updater_.UpdateCommandEnabled(IDC_TAB_SEARCH,
enable_tab_search_commands);
command_updater_.UpdateCommandEnabled(IDC_TAB_SEARCH_CLOSE,
2025-06-15 07:00:38 -05:00
--- a/chrome/browser/ui/ui_features.cc
+++ b/chrome/browser/ui/ui_features.cc
2025-09-24 15:57:30 -05:00
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/ui_features.h"
+#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/metrics/field_trial_params.h"
#include "base/time/time.h"
2025-11-20 11:54:19 -06:00
@@ -656,6 +657,10 @@ static std::string GetCountryCode() {
2025-06-15 07:00:38 -05:00
}
2025-08-27 17:27:06 -05:00
bool HasTabSearchToolbarButton() {
2025-06-15 07:00:38 -05:00
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("remove-tabsearch-button")) {
+ return false;
+ }
+
static const bool is_tab_search_moving = [] {
if (GetCountryCode() == "us" &&
base::FeatureList::IsEnabled(
2025-04-23 15:07:40 -05:00
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
2025-11-20 11:54:19 -06:00
@@ -4475,6 +4475,9 @@ BookmarkBar::State BrowserView::bookmark
}
2025-04-23 15:07:40 -05:00
2025-11-20 11:54:19 -06:00
void BrowserView::UpdateTabSearchBubbleHost() {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("remove-tabsearch-button")) {
+ return;
+ }
if (!GetIsNormalType()) {
return;
}
2021-07-23 13:47:10 -05:00
--- a/chrome/browser/ui/views/frame/tab_strip_region_view.cc
+++ b/chrome/browser/ui/views/frame/tab_strip_region_view.cc
2023-03-01 16:05:16 -06:00
@@ -4,6 +4,7 @@
2021-07-23 13:47:10 -05:00
#include "chrome/browser/ui/views/frame/tab_strip_region_view.h"
+#include "base/command_line.h"
2023-03-01 16:05:16 -06:00
#include "base/functional/bind.h"
2021-07-23 13:47:10 -05:00
#include "base/strings/utf_string_conversions.h"
2025-02-23 17:24:33 -06:00
#include "base/task/single_thread_task_runner.h"
2025-09-24 15:57:30 -05:00
@@ -209,6 +210,7 @@ TabStripRegionView::TabStripRegionView(s
2025-08-27 17:27:06 -05:00
std::unique_ptr<TabStripActionContainer> tab_strip_action_container;
2025-01-08 14:03:54 -06:00
std::unique_ptr<ProductSpecificationsButton> product_specifications_button;
if (browser &&
+ !base::CommandLine::ForCurrentProcess()->HasSwitch("remove-tabsearch-button") &&
(browser->GetType() == BrowserWindowInterface::Type::TYPE_NORMAL)) {
2025-08-27 17:27:06 -05:00
if (features::HasTabSearchToolbarButton()) {
tab_strip_action_container = std::make_unique<TabStripActionContainer>(
2021-07-23 13:47:10 -05:00
--- a/chrome/browser/ungoogled_flag_entries.h
+++ b/chrome/browser/ungoogled_flag_entries.h
2022-04-02 22:51:28 +00:00
@@ -60,4 +60,8 @@
2021-07-23 13:47:10 -05:00
"Clear data on exit",
"Clears all browsing data on exit. ungoogled-chromium flag",
2024-05-08 19:52:04 -05:00
kOsDesktop, FEATURE_VALUE_TYPE(features::kClearDataOnExit)},
2021-07-23 13:47:10 -05:00
+ {"remove-tabsearch-button",
+ "Remove Tabsearch Button",
+ "Removes the tabsearch button from the tabstrip. ungoogled-chromium flag",
2021-07-23 13:47:10 -05:00
+ kOsDesktop, SINGLE_VALUE_TYPE("remove-tabsearch-button")},
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_