1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- --- a/chrome/browser/ui/views/tabs/tab.cc
- +++ b/chrome/browser/ui/views/tabs/tab.cc
- @@ -12,6 +12,7 @@
- #include <utility>
-
- #include "base/bind.h"
- +#include "base/command_line.h"
- #include "base/debug/alias.h"
- #include "base/i18n/rtl.h"
- #include "base/metrics/user_metrics.h"
- @@ -636,6 +637,8 @@ void Tab::OnGestureEvent(ui::GestureEven
- }
-
- std::u16string Tab::GetTooltipText(const gfx::Point& p) const {
- + if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("tab-hover-cards") == "tooltip")
- + return GetTooltipText(data_.title, GetAlertStateToShow(data_.alert_state));
- // Tab hover cards replace tooltips for tabs.
- return std::u16string();
- }
- --- a/chrome/browser/ui/views/tabs/tab_strip.cc
- +++ b/chrome/browser/ui/views/tabs/tab_strip.cc
- @@ -15,6 +15,7 @@
-
- #include "base/bind.h"
- #include "base/callback.h"
- +#include "base/command_line.h"
- #include "base/compiler_specific.h"
- #include "base/containers/adapters.h"
- #include "base/containers/contains.h"
- @@ -1844,6 +1845,8 @@ void TabStrip::OnMouseEventInTab(views::
- }
-
- void TabStrip::UpdateHoverCard(Tab* tab, HoverCardUpdateType update_type) {
- + if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("tab-hover-cards") == "tooltip" ||
- + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("tab-hover-cards") == "none") return;
- // Some operations (including e.g. starting a drag) can cause the tab focus
- // to change at the same time as the tabstrip is starting to animate; the
- // hover card should not be visible at this time.
- --- a/chrome/browser/ungoogled_flag_choices.h
- +++ b/chrome/browser/ungoogled_flag_choices.h
- @@ -75,4 +75,13 @@ const FeatureEntry::Choice kCloseConfirm
- "close-confirmation",
- "multiple"},
- };
- +const FeatureEntry::Choice kTabHoverCards[] = {
- + {flags_ui::kGenericExperimentChoiceDefault, "", ""},
- + {"None",
- + "tab-hover-cards",
- + "none"},
- + {"Tooltip",
- + "tab-hover-cards",
- + "tooltip"},
- +};
- #endif // CHROME_BROWSER_UNGOOGLED_FLAG_CHOICES_H_
- --- a/chrome/browser/ungoogled_flag_entries.h
- +++ b/chrome/browser/ungoogled_flag_entries.h
- @@ -84,4 +84,8 @@
- "Custom New Tab Page",
- "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",
- kOsDesktop, ORIGIN_LIST_VALUE_TYPE("custom-ntp", "")},
- + {"tab-hover-cards",
- + "Tab Hover Cards",
- + "Allows removing the tab hover cards or using a tooltip as a replacement. ungoogled-chromium flag.",
- + kOsDesktop, MULTI_VALUE_TYPE(kTabHoverCards)},
- #endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_
|