Procházet zdrojové kódy

Add flag for tabsearch button

Blaise před 2 roky
rodič
revize
91e28f7078

+ 1 - 0
docs/flags.md

@@ -31,6 +31,7 @@ If a switch requires a value, you must specify it with an `=` sign; e.g. flag `-
   `--bookmark-bar-ntp` | Sets the visibility of the bookmark bar on the New Tab Page. Only takes the value `never`.
   `--close-window-with-last-tab` | Determines whether a window should close once the last tab is closed.  Only takes the value `never`.
   `--pdf-plugin-name` | Sets the internal PDF viewer plugin name. Useful for sites that probe JavaScript API `navigator.plugins`. Supports values `chrome` for Chrome, `edge` for Microsoft Edge. Default value when omitted is Chromium.
+  `--remove-tabsearch-button` | Removes the tabsearch button from the tabstrip.
   `--scroll-tabs` | Determines if scrolling will cause a switch to a neighboring tab if the cursor hovers over the tabs, or the empty space beside the tabs. The flag requires one the values: `always`, `never`, `incognito-and-guest`. When omitted, the default is to use platform-specific behavior, which is currently enabled only on desktop Linux.
   `--show-avatar-button` | Sets visibility of the avatar button. The flag requires one of the values: `always`, `incognito-and-guest` (only show Incognito or Guest modes), or `never`.
 

+ 43 - 0
patches/extra/ungoogled-chromium/add-flag-for-tabsearch-button.patch

@@ -0,0 +1,43 @@
+--- a/chrome/browser/ui/browser_command_controller.cc
++++ b/chrome/browser/ui/browser_command_controller.cc
+@@ -1110,7 +1110,8 @@ void BrowserCommandController::InitComma
+   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,
+--- a/chrome/browser/ui/views/frame/tab_strip_region_view.cc
++++ b/chrome/browser/ui/views/frame/tab_strip_region_view.cc
+@@ -5,6 +5,7 @@
+ #include "chrome/browser/ui/views/frame/tab_strip_region_view.h"
+ 
+ #include "base/bind.h"
++#include "base/command_line.h"
+ #include "base/strings/utf_string_conversions.h"
+ #include "chrome/app/vector_icons/vector_icons.h"
+ #include "chrome/browser/ui/layout_constants.h"
+@@ -260,7 +261,8 @@ TabStripRegionView::TabStripRegionView(s
+   tip_marquee_view_->SetProperty(views::kMarginsKey, control_padding);
+ 
+   const Browser* browser = tab_strip_->controller()->GetBrowser();
+-  if (browser && browser->is_type_normal()) {
++  if (browser && browser->is_type_normal() &&
++      !base::CommandLine::ForCurrentProcess()->HasSwitch("remove-tabsearch-button")) {
+     auto tab_search_button = std::make_unique<TabSearchButton>(tab_strip_);
+     tab_search_button->SetTooltipText(
+         l10n_util::GetStringUTF16(IDS_TOOLTIP_TAB_SEARCH));
+--- a/chrome/browser/ungoogled_flag_entries.h
++++ b/chrome/browser/ungoogled_flag_entries.h
+@@ -68,4 +68,8 @@
+      "Clear data on exit",
+      "Clears all browsing data on exit.  ungoogled-chromium flag",
+      kOsDesktop, FEATURE_VALUE_TYPE(browsing_data::features::kClearDataOnExit)},
++    {"remove-tabsearch-button",
++     "Remove Tabsearch Button",
++     "Removes the tabsearch button from the tabstrip.  ungoogled-chromium flag",
++     kOsDesktop, SINGLE_VALUE_TYPE("remove-tabsearch-button")},
+ #endif  // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_

+ 1 - 0
patches/series

@@ -89,6 +89,7 @@ extra/ungoogled-chromium/add-extra-channel-info.patch
 extra/ungoogled-chromium/prepopulated-search-engines.patch
 extra/ungoogled-chromium/fix-distilled-icons.patch
 extra/ungoogled-chromium/add-flag-to-clear-data-on-exit.patch
+extra/ungoogled-chromium/add-flag-for-tabsearch-button.patch
 extra/bromite/fingerprinting-flags-client-rects-and-measuretext.patch
 extra/bromite/flag-max-connections-per-host.patch
 extra/bromite/flag-fingerprinting-canvas-image-data-noise.patch