Chromium Code Reviews| Index: chrome/browser/ui/views/tabs/media_indicator_button.cc |
| diff --git a/chrome/browser/ui/views/tabs/media_indicator_button.cc b/chrome/browser/ui/views/tabs/media_indicator_button.cc |
| index 96e9b0b081854de9f49b7363d43989ffda0fcd17..c8ed5fdf25f2c2b705a7a15da2c5778a553b5dfa 100644 |
| --- a/chrome/browser/ui/views/tabs/media_indicator_button.cc |
| +++ b/chrome/browser/ui/views/tabs/media_indicator_button.cc |
| @@ -49,13 +49,12 @@ class MediaIndicatorButton::FadeAnimationDelegate |
| } |
| void AnimationCanceled(const gfx::Animation* animation) override { |
| - button_->showing_media_state_ = button_->media_state_; |
| - button_->SchedulePaint(); |
| + AnimationEnded(animation); |
| } |
| void AnimationEnded(const gfx::Animation* animation) override { |
| button_->showing_media_state_ = button_->media_state_; |
| - button_->SchedulePaint(); |
| + button_->parent_tab_->MediaStateChanged(); |
| } |
| MediaIndicatorButton* const button_; |
| @@ -78,6 +77,7 @@ MediaIndicatorButton::~MediaIndicatorButton() {} |
| void MediaIndicatorButton::TransitionToMediaState(TabMediaState next_state) { |
| if (next_state == media_state_) |
| return; |
| + bool previous_media_showing_state = showing_media_state_; |
|
miu
2016/02/01 20:28:32
The type should be TabMediaState, not bool.
enne (OOO)
2016/02/01 20:36:33
Eep! Thanks.
|
| if (next_state != TAB_MEDIA_STATE_NONE) |
| ResetImages(next_state); |
| @@ -105,6 +105,9 @@ void MediaIndicatorButton::TransitionToMediaState(TabMediaState next_state) { |
| media_state_ = next_state; |
| + if (previous_media_showing_state != showing_media_state_) |
| + parent_tab_->MediaStateChanged(); |
| + |
| UpdateEnabledForMuteToggle(); |
| // An indicator state change should be made visible immediately, instead of |