summaryrefslogtreecommitdiff
path: root/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-show-avatar-button.patch
diff options
context:
space:
mode:
Diffstat (limited to 'www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-show-avatar-button.patch')
-rw-r--r--www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-show-avatar-button.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-show-avatar-button.patch b/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-show-avatar-button.patch
new file mode 100644
index 0000000..8fe39bd
--- /dev/null
+++ b/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-show-avatar-button.patch
@@ -0,0 +1,63 @@
1--- chrome/browser/ui/views/toolbar/toolbar_view.cc.orig
2+++ chrome/browser/ui/views/toolbar/toolbar_view.cc
3@@ -273,12 +273,28 @@ void ToolbarView::Init() {
4
5 std::unique_ptr<ToolbarAccountIconContainerView>
6 toolbar_account_icon_container;
7+
8+ const base::CommandLine& command_line =
9+ *base::CommandLine::ForCurrentProcess();
10+ const std::string flag_value =
11+ command_line.GetSwitchValueASCII("show-avatar-button");
12+
13+ bool in_incognito_or_guest_mode = browser_->profile()->IsOffTheRecord() ||
14+ browser_->profile()->IsGuestSession();
15+
16 bool show_avatar_toolbar_button = true;
17 #if BUILDFLAG(IS_CHROMEOS_ASH)
18 // ChromeOS only badges Incognito and Guest icons in the browser window.
19- show_avatar_toolbar_button = browser_->profile()->IsOffTheRecord() ||
20- browser_->profile()->IsGuestSession();
21+ show_avatar_toolbar_button = in_incognito_or_guest_mode;
22 #endif
23+
24+ if (flag_value == "always")
25+ show_avatar_toolbar_button = true;
26+ else if (flag_value == "incognito-and-guest")
27+ show_avatar_toolbar_button = in_incognito_or_guest_mode;
28+ else if (flag_value == "never")
29+ show_avatar_toolbar_button = false;
30+
31 if (base::FeatureList::IsEnabled(
32 autofill::features::kAutofillEnableToolbarStatusChip)) {
33 // The avatar button is contained inside the page-action container and
34--- chrome/browser/ungoogled_flag_choices.h.orig
35+++ chrome/browser/ungoogled_flag_choices.h
36@@ -13,4 +13,16 @@ const FeatureEntry::Choice kExtensionHan
37 "extension-mime-request-handling",
38 "always-prompt-for-install"},
39 };
40+const FeatureEntry::Choice kShowAvatarButtonChoices[] = {
41+ {flags_ui::kGenericExperimentChoiceDefault, "", ""},
42+ {"Always",
43+ "show-avatar-button",
44+ "always"},
45+ {"Incognito and Guest",
46+ "show-avatar-button",
47+ "incognito-and-guest"},
48+ {"Never",
49+ "show-avatar-button",
50+ "never"}
51+};
52 #endif // CHROME_BROWSER_UNGOOGLED_FLAG_CHOICES_H_
53--- chrome/browser/ungoogled_flag_entries.h.orig
54+++ chrome/browser/ungoogled_flag_entries.h
55@@ -28,4 +28,8 @@
56 "Force punycode hostnames",
57 "Force punycode in hostnames instead of Unicode when displaying Internationalized Domain Names (IDNs). ungoogled-chromium flag.",
58 kOsAll, SINGLE_VALUE_TYPE("force-punycode-hostnames")},
59+ {"show-avatar-button",
60+ "Show avatar/people/profile button",
61+ "Show avatar/people/profile button in the browser toolbar. ungoogled-chromium flag.",
62+ kOsDesktop, MULTI_VALUE_TYPE(kShowAvatarButtonChoices)},
63 #endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_