diff options
Diffstat (limited to 'www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-for-tab-hover-cards.patch')
| -rw-r--r-- | www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-for-tab-hover-cards.patch | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-for-tab-hover-cards.patch b/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-for-tab-hover-cards.patch new file mode 100644 index 0000000..6010902 --- /dev/null +++ b/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-for-tab-hover-cards.patch | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | --- chrome/browser/ui/views/tabs/tab.cc.orig | ||
| 2 | +++ chrome/browser/ui/views/tabs/tab.cc | ||
| 3 | @@ -12,6 +12,7 @@ | ||
| 4 | #include <utility> | ||
| 5 | |||
| 6 | #include "base/bind.h" | ||
| 7 | +#include "base/command_line.h" | ||
| 8 | #include "base/debug/alias.h" | ||
| 9 | #include "base/i18n/rtl.h" | ||
| 10 | #include "base/metrics/user_metrics.h" | ||
| 11 | @@ -641,6 +642,8 @@ void Tab::OnGestureEvent(ui::GestureEven | ||
| 12 | } | ||
| 13 | |||
| 14 | std::u16string Tab::GetTooltipText(const gfx::Point& p) const { | ||
| 15 | + if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("tab-hover-cards") == "tooltip") | ||
| 16 | + return GetTooltipText(data_.title, GetAlertStateToShow(data_.alert_state)); | ||
| 17 | // Tab hover cards replace tooltips for tabs. | ||
| 18 | return std::u16string(); | ||
| 19 | } | ||
| 20 | --- chrome/browser/ui/views/tabs/tab_strip.cc.orig | ||
| 21 | +++ chrome/browser/ui/views/tabs/tab_strip.cc | ||
| 22 | @@ -15,6 +15,7 @@ | ||
| 23 | |||
| 24 | #include "base/bind.h" | ||
| 25 | #include "base/callback.h" | ||
| 26 | +#include "base/command_line.h" | ||
| 27 | #include "base/compiler_specific.h" | ||
| 28 | #include "base/containers/adapters.h" | ||
| 29 | #include "base/containers/contains.h" | ||
| 30 | @@ -2153,6 +2154,8 @@ void TabStrip::OnMouseEventInTab(views:: | ||
| 31 | } | ||
| 32 | |||
| 33 | void TabStrip::UpdateHoverCard(Tab* tab, HoverCardUpdateType update_type) { | ||
| 34 | + if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("tab-hover-cards") == "tooltip" || | ||
| 35 | + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("tab-hover-cards") == "none") return; | ||
| 36 | // Some operations (including e.g. starting a drag) can cause the tab focus | ||
| 37 | // to change at the same time as the tabstrip is starting to animate; the | ||
| 38 | // hover card should not be visible at this time. | ||
| 39 | --- chrome/browser/ungoogled_flag_choices.h.orig | ||
| 40 | +++ chrome/browser/ungoogled_flag_choices.h | ||
| 41 | @@ -75,4 +75,13 @@ const FeatureEntry::Choice kCloseConfirm | ||
| 42 | "close-confirmation", | ||
| 43 | "multiple"}, | ||
| 44 | }; | ||
| 45 | +const FeatureEntry::Choice kTabHoverCards[] = { | ||
| 46 | + {flags_ui::kGenericExperimentChoiceDefault, "", ""}, | ||
| 47 | + {"None", | ||
| 48 | + "tab-hover-cards", | ||
| 49 | + "none"}, | ||
| 50 | + {"Tooltip", | ||
| 51 | + "tab-hover-cards", | ||
| 52 | + "tooltip"}, | ||
| 53 | +}; | ||
| 54 | #endif // CHROME_BROWSER_UNGOOGLED_FLAG_CHOICES_H_ | ||
| 55 | --- chrome/browser/ungoogled_flag_entries.h.orig | ||
| 56 | +++ chrome/browser/ungoogled_flag_entries.h | ||
| 57 | @@ -88,4 +88,8 @@ | ||
| 58 | "Custom New Tab Page", | ||
| 59 | "Allows setting a custom URL for the new tab page. Value can be internal (e.g. `about:blank`), external (e.g. `example.com`), or local (e.g. `file:///tmp/startpage.html`). This applies for incognito windows as well when not set to a `chrome://` internal page. ungoogled-chromium flag", | ||
| 60 | kOsDesktop, ORIGIN_LIST_VALUE_TYPE("custom-ntp", "")}, | ||
| 61 | + {"tab-hover-cards", | ||
| 62 | + "Tab Hover Cards", | ||
| 63 | + "Allows removing the tab hover cards or using a tooltip as a replacement. ungoogled-chromium flag.", | ||
| 64 | + kOsDesktop, MULTI_VALUE_TYPE(kTabHoverCards)}, | ||
| 65 | #endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_ | ||
