add-flag-to-show-avatar-button.patch: rm redundant conditions

This commit is contained in:
qvint
2018-10-07 16:45:43 +03:00
parent 757b13be0d
commit 7689ed3f4f
@@ -79,16 +79,13 @@
// This should never be called in incognito mode.
DCHECK(browser_view->IsRegularOrGuestSession());
ProfileAttributesEntry* unused;
@@ -42,7 +48,13 @@ void AvatarButtonManager::Update(AvatarB
@@ -42,7 +48,10 @@ void AvatarButtonManager::Update(AvatarB
->GetProfileAttributesStorage()
.GetProfileAttributesWithPath(profile->GetPath(), &unused)) ||
// Desktop guest shows the avatar button.
- browser_view->IsIncognito())) {
+ browser_view->IsIncognito() ||
+ browser_view->IsIncognito()) &&
+ // Override according to show-avatar-button value.
+ (flag_value == "always") ||
+ (flag_value == "incognito-and-guest" && in_incognito_or_guest_mode)
+ ) &&
+ !(flag_value == "incognito-and-guest" && !in_incognito_or_guest_mode) &&
+ !(flag_value == "never")) {
if (!avatar_button_) {