Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1162)

Unified Diff: chrome/browser/ui/views/tabs/media_indicator_button.cc

Issue 1653113002: Fix favicon disappearing on pinned tabs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698