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

Unified Diff: chrome/browser/ui/cocoa/tabs/alert_indicator_button_cocoa.mm

Issue 1883033002: [Mac] Update tab audio icon to Material Design and tweak close box color. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/cocoa/tabs/alert_indicator_button_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/tabs/alert_indicator_button_cocoa.mm b/chrome/browser/ui/cocoa/tabs/alert_indicator_button_cocoa.mm
index 7bfde635e58cbed315e936a7a0c1051b95215500..0bfe358743f9352742b0dcf61d37c33d08875ae5 100644
--- a/chrome/browser/ui/cocoa/tabs/alert_indicator_button_cocoa.mm
+++ b/chrome/browser/ui/cocoa/tabs/alert_indicator_button_cocoa.mm
@@ -72,17 +72,22 @@ class FadeAnimationDelegate : public gfx::AnimationDelegate {
[super removeFromSuperview];
}
+- (void)updateIconForState:(TabAlertState)aState {
+ if (aState != TabAlertState::NONE) {
+ TabView* const tabView = base::mac::ObjCCast<TabView>([self superview]);
+ SkColor iconColor = [tabView closeButtonColor];
+ NSImage* tabIndicatorImage =
+ chrome::GetTabAlertIndicatorImage(aState, iconColor).ToNSImage();
+ [self setImage:tabIndicatorImage];
+ affordanceImage_.reset([tabIndicatorImage retain]);
Avi (use Gerrit) 2016/04/14 02:35:08 You can do affordanceImage_.reset(tabIndicatorIma
+ }
+}
+
- (void)transitionToAlertState:(TabAlertState)nextState {
if (nextState == alertState_)
return;
- if (nextState != TabAlertState::NONE) {
- [self
- setImage:chrome::GetTabAlertIndicatorImage(nextState, 0).ToNSImage()];
- affordanceImage_.reset(
- [chrome::GetTabAlertIndicatorAffordanceImage(nextState, 0)
- .ToNSImage() retain]);
- }
+ [self updateIconForState:nextState];
if ((alertState_ == TabAlertState::AUDIO_PLAYING &&
nextState == TabAlertState::AUDIO_MUTING) ||
@@ -237,4 +242,15 @@ class FadeAnimationDelegate : public gfx::AnimationDelegate {
[self setEnabled:enable];
}
+// ThemedWindowDrawing protocol support.
+
+- (void)windowDidChangeTheme {
+ // Force the alert icon to update because the icon color may change based
+ // on the current theme.
+ [self updateIconForState:alertState_];
+}
+
+- (void)windowDidChangeActive {
+}
+
@end
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/alert_indicator_button_cocoa.h ('k') | chrome/browser/ui/cocoa/tabs/tab_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698