Commit 1bb4afbe authored by siyua's avatar siyua Committed by Commit Bot

[Status Chip] Remove avatar button state suppresion when icon in status

chip is visible.

Uploaded screenshot in bug comment 30

Bug: 932818
Change-Id: I7e69019e18e7a217c3757a787bbb7be3810922ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1848579Reviewed-by: default avatarPeter Boström <pbos@chromium.org>
Reviewed-by: default avatarJan Krcal <jkrcal@chromium.org>
Commit-Queue: Siyu An <siyua@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704223}
parent 2545d011
...@@ -261,12 +261,6 @@ void AvatarToolbarButton::UpdateText() { ...@@ -261,12 +261,6 @@ void AvatarToolbarButton::UpdateText() {
SetHighlight(text, color); SetHighlight(text, color);
} }
void AvatarToolbarButton::SetAutofillIconVisible(bool autofill_icon_visible) {
DCHECK_NE(GetState(), State::kIncognitoProfile);
autofill_icon_visible_ = autofill_icon_visible;
UpdateText();
}
void AvatarToolbarButton::ShowAvatarHighlightAnimation() { void AvatarToolbarButton::ShowAvatarHighlightAnimation() {
DCHECK_NE(GetState(), State::kIncognitoProfile); DCHECK_NE(GetState(), State::kIncognitoProfile);
DCHECK_NE(GetState(), State::kGuestSession); DCHECK_NE(GetState(), State::kGuestSession);
...@@ -554,7 +548,7 @@ AvatarToolbarButton::State AvatarToolbarButton::GetState() const { ...@@ -554,7 +548,7 @@ AvatarToolbarButton::State AvatarToolbarButton::GetState() const {
#if !defined(OS_CHROMEOS) #if !defined(OS_CHROMEOS)
if (identity_manager->HasPrimaryAccount() && profile_->IsSyncAllowed() && if (identity_manager->HasPrimaryAccount() && profile_->IsSyncAllowed() &&
error_controller_.HasAvatarError() && !autofill_icon_visible_) { error_controller_.HasAvatarError()) {
// When DICE is enabled and the error is an auth error, the sync-paused // When DICE is enabled and the error is an auth error, the sync-paused
// icon is shown. // icon is shown.
int unused; int unused;
......
...@@ -36,7 +36,6 @@ class AvatarToolbarButton : public ToolbarButton, ...@@ -36,7 +36,6 @@ class AvatarToolbarButton : public ToolbarButton,
void UpdateIcon(); void UpdateIcon();
void UpdateText(); void UpdateText();
void SetAutofillIconVisible(bool autofill_icon_visible);
void ShowAvatarHighlightAnimation(); void ShowAvatarHighlightAnimation();
private: private:
...@@ -136,11 +135,6 @@ class AvatarToolbarButton : public ToolbarButton, ...@@ -136,11 +135,6 @@ class AvatarToolbarButton : public ToolbarButton,
// button sync paused/error state and update highlight color. // button sync paused/error state and update highlight color.
bool highlight_animation_visible_ = false; bool highlight_animation_visible_ = false;
// Whether any autofill icon is visible in |this|'s parent container. Set by
// |ToolbarPageActionIconContainerView|. If true, hide avatar button sync
// paused/error state.
bool autofill_icon_visible_ = false;
IdentityAnimationState identity_animation_state_ = IdentityAnimationState identity_animation_state_ =
IdentityAnimationState::kNotShowing; IdentityAnimationState::kNotShowing;
......
...@@ -73,18 +73,6 @@ void ToolbarAccountIconContainerView::OnThemeChanged() { ...@@ -73,18 +73,6 @@ void ToolbarAccountIconContainerView::OnThemeChanged() {
UpdateAllIcons(); UpdateAllIcons();
} }
void ToolbarAccountIconContainerView::ChildVisibilityChanged(View* child) {
// The avatar should not show UI for paused state or error state when any icon
// in the toolbar page action icon container view is visible.
// If it is in Incognito window, the avatar button shows a text "Incognito"
// which should not be updated in any case.
if (browser_->profile()->IsIncognitoProfile())
return;
avatar_->SetAutofillIconVisible(
page_action_icon_container_view_->IsAnyIconVisible());
}
SkColor ToolbarAccountIconContainerView::GetIconColor() const { SkColor ToolbarAccountIconContainerView::GetIconColor() const {
return GetThemeProvider()->GetColor( return GetThemeProvider()->GetColor(
ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON); ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON);
......
...@@ -32,7 +32,6 @@ class ToolbarAccountIconContainerView : public ToolbarIconContainerView, ...@@ -32,7 +32,6 @@ class ToolbarAccountIconContainerView : public ToolbarIconContainerView,
// views::View: // views::View:
void OnThemeChanged() override; void OnThemeChanged() override;
void ChildVisibilityChanged(View* child) override;
PageActionIconContainerView* page_action_icon_container() { PageActionIconContainerView* page_action_icon_container() {
return page_action_icon_container_view_; return page_action_icon_container_view_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment