123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- --- a/chrome/browser/about_flags.cc
- +++ b/chrome/browser/about_flags.cc
- @@ -235,6 +235,19 @@ const FeatureEntry::Choice kExtensionHan
- "always-prompt-for-install"},
- };
-
- +const FeatureEntry::Choice kShowAvatarButtonChoices[] = {
- + {flags_ui::kGenericExperimentChoiceDefault, "", ""},
- + {"Always",
- + "show-avatar-button",
- + "always"},
- + {"Incognito and Guest",
- + "show-avatar-button",
- + "incognito-and-guest"},
- + {"Never",
- + "show-avatar-button",
- + "never"}
- +};
- +
- const FeatureEntry::Choice kTouchEventFeatureDetectionChoices[] = {
- {flags_ui::kGenericExperimentChoiceDisabled, "", ""},
- {flags_ui::kGenericExperimentChoiceEnabled,
- @@ -3548,6 +3561,11 @@ const FeatureEntry kFeatureEntries[] = {
- FEATURE_VALUE_TYPE(arc::kEnableUnifiedAudioFocusFeature)},
- #endif // defined(OS_CHROMEOS)
-
- + {"show-avatar-button",
- + "Show avatar button",
- + "Show avatar button in the browser toolbar", kOsDesktop,
- + MULTI_VALUE_TYPE(kShowAvatarButtonChoices)},
- +
- #if defined(OS_WIN)
- {"use-angle", flag_descriptions::kUseAngleName,
- flag_descriptions::kUseAngleDescription, kOsWin,
- --- a/chrome/browser/ui/views/toolbar/toolbar_view.cc
- +++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
- @@ -248,6 +248,15 @@ void ToolbarView::Init() {
-
- std::unique_ptr<ToolbarPageActionIconContainerView>
- toolbar_page_action_container;
- +
- + const base::CommandLine& command_line =
- + *base::CommandLine::ForCurrentProcess();
- + const std::string flag_value =
- + command_line.GetSwitchValueASCII("show-avatar-button");
- +
- + bool in_incognito_or_guest_mode = browser_->profile()->IsOffTheRecord() ||
- + browser_->profile()->IsGuestSession();
- +
- bool show_avatar_toolbar_button = true;
- if (base::FeatureList::IsEnabled(
- autofill::features::kAutofillEnableToolbarStatusChip)) {
- @@ -259,11 +268,17 @@ void ToolbarView::Init() {
- } else {
- #if defined(OS_CHROMEOS)
- // ChromeOS only badges Incognito and Guest icons in the browser window.
- - show_avatar_toolbar_button = browser_->profile()->IsOffTheRecord() ||
- - browser_->profile()->IsGuestSession();
- + show_avatar_toolbar_button = in_incognito_or_guest_mode;
- #endif
- }
-
- + if (flag_value == "always")
- + show_avatar_toolbar_button = true;
- + else if (flag_value == "incognito-and-guest")
- + show_avatar_toolbar_button = in_incognito_or_guest_mode;
- + else if (flag_value == "never")
- + show_avatar_toolbar_button = false;
- +
- std::unique_ptr<AvatarToolbarButton> avatar;
- if (show_avatar_toolbar_button)
- avatar = std::make_unique<AvatarToolbarButton>(browser_);
|