-
Notifications
You must be signed in to change notification settings - Fork 864
/
Copy pathadd-flag-for-tab-hover-cards.patch
65 lines (60 loc) · 2.56 KB
/
add-flag-for-tab-hover-cards.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
--- a/chrome/browser/ui/views/tabs/tab.cc
+++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -16,6 +16,7 @@
#include <memory>
#include <utility>
+#include "base/command_line.h"
#include "base/debug/alias.h"
#include "base/functional/bind.h"
#include "base/i18n/rtl.h"
@@ -703,6 +704,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
@@ -19,6 +19,7 @@
#include <utility>
#include <vector>
+#include "base/command_line.h"
#include "base/check.h"
#include "base/compiler_specific.h"
#include "base/containers/adapters.h"
@@ -1835,6 +1836,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;
tab_container_->UpdateHoverCard(tab, update_type);
}
--- a/chrome/browser/ungoogled_flag_choices.h
+++ b/chrome/browser/ungoogled_flag_choices.h
@@ -70,4 +70,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
@@ -80,4 +80,8 @@
"Custom New Tab Page",
"Allows setting a custom URL for the new tab page. Value can be internal (e.g. `about:blank` or `chrome://new-tab-page`), 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_