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

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

Issue 1354823002: Render the tab close button as a vector-based icon. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove pointless #includes Created 5 years, 3 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
Index: chrome/browser/ui/views/tabs/media_indicator_button.h
diff --git a/chrome/browser/ui/views/tabs/media_indicator_button.h b/chrome/browser/ui/views/tabs/media_indicator_button.h
index e605cca9d28660feaa45294909b118c425204fe6..c5e7852cc8e1758edbe1600d003aaec1b213b42a 100644
--- a/chrome/browser/ui/views/tabs/media_indicator_button.h
+++ b/chrome/browser/ui/views/tabs/media_indicator_button.h
@@ -40,8 +40,8 @@ class MediaIndicatorButton : public views::ImageButton,
return showing_media_state_;
}
- // Updates ImageButton images, starts fade animations, and
- // activates/deactivates button functionality as appropriate.
+ // Calls ResetImages(), starts fade animations, and activates/deactivates
+ // button functionality as appropriate.
void TransitionToMediaState(TabMediaState next_state);
// Determines whether the MediaIndicatorButton will be clickable for toggling
@@ -50,6 +50,10 @@ class MediaIndicatorButton : public views::ImageButton,
// calls this when the TabMediaState or the bounds have changed.
void UpdateEnabledForMuteToggle();
+ // Called when the parent tab's button color changes. Determines whether
+ // ResetImages() needs to be called.
+ void OnParentTabButtonColorChanged();
+
protected:
// views::View:
const char* GetClassName() const override;
@@ -77,6 +81,10 @@ class MediaIndicatorButton : public views::ImageButton,
// Returns the tab (parent view) of this MediaIndicatorButton.
Tab* GetTab() const;
+ // Resets the images to display on the button to reflect |state| and the
+ // parent tab's button color. Should be called when either of these changes.
+ void ResetImages(TabMediaState state);
+
Tab* const parent_tab_;
TabMediaState media_state_;

Powered by Google App Engine
This is Rietveld 408576698