Commit 6680bbcc authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

Return color to the microphone tab indicator.

BUG=843075

Change-Id: Iccb161d3d584cf434ae20b5ec91134b04996c999
Reviewed-on: https://chromium-review.googlesource.com/1062411Reviewed-by: default avatarSidney San Martín <sdy@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559268}
parent 298ef248
...@@ -83,7 +83,7 @@ class FadeAnimationDelegate : public gfx::AnimationDelegate { ...@@ -83,7 +83,7 @@ class FadeAnimationDelegate : public gfx::AnimationDelegate {
- (void)updateIconForState:(TabAlertState)aState { - (void)updateIconForState:(TabAlertState)aState {
if (aState != TabAlertState::NONE) { if (aState != TabAlertState::NONE) {
TabView* const tabView = base::mac::ObjCCast<TabView>([self superview]); TabView* const tabView = base::mac::ObjCCast<TabView>([self superview]);
SkColor iconColor = [tabView iconColor]; SkColor iconColor = [tabView alertIndicatorColorForState:aState];
NSImage* tabIndicatorImage = NSImage* tabIndicatorImage =
chrome::GetTabAlertIndicatorImage(aState, iconColor).ToNSImage(); chrome::GetTabAlertIndicatorImage(aState, iconColor).ToNSImage();
NSImage* affordanceImage = NSImage* affordanceImage =
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "base/mac/scoped_nsobject.h" #include "base/mac/scoped_nsobject.h"
#import "chrome/browser/ui/cocoa/hover_close_button.h" #import "chrome/browser/ui/cocoa/hover_close_button.h"
#import "chrome/browser/ui/cocoa/themed_window.h" #import "chrome/browser/ui/cocoa/themed_window.h"
#include "chrome/browser/ui/tabs/tab_utils.h"
namespace tabs { namespace tabs {
...@@ -95,10 +96,13 @@ const SkColor kDefaultTabTextColor = SkColorSetARGB(0xA0, 0x00, 0x00, 0x00); ...@@ -95,10 +96,13 @@ const SkColor kDefaultTabTextColor = SkColorSetARGB(0xA0, 0x00, 0x00, 0x00);
// user to click to select/activate the tab. // user to click to select/activate the tab.
- (int)widthOfLargestSelectableRegion; - (int)widthOfLargestSelectableRegion;
// Returns the Material Design color of the icons. Used by the alert indicator, // Returns the Material Design color of the icons. Used by the "x" and the
// the "x", and the default favicon. // default favicon.
- (SkColor)iconColor; - (SkColor)iconColor;
// Returns the Material Design color of the alert indicator.
- (SkColor)alertIndicatorColorForState:(TabAlertState)state;
// Called when systemwide accessibility options change. // Called when systemwide accessibility options change.
- (void)accessibilityOptionsDidChange:(id)ignored; - (void)accessibilityOptionsDidChange:(id)ignored;
......
...@@ -674,6 +674,30 @@ CGFloat LineWidthFromContext(CGContextRef context) { ...@@ -674,6 +674,30 @@ CGFloat LineWidthFromContext(CGContextRef context) {
return tabs::kDefaultTabTextColor; return tabs::kDefaultTabTextColor;
} }
- (SkColor)alertIndicatorColorForState:(TabAlertState)state {
// If theme provider is not yet available, return the default button
// color.
const ui::ThemeProvider* themeProvider = [[self window] themeProvider];
if (!themeProvider)
return [self iconColor];
switch (state) {
case TabAlertState::MEDIA_RECORDING:
return themeProvider->GetColor(
ThemeProperties::COLOR_TAB_ALERT_RECORDING);
case TabAlertState::AUDIO_PLAYING:
case TabAlertState::AUDIO_MUTING:
case TabAlertState::TAB_CAPTURING:
case TabAlertState::BLUETOOTH_CONNECTED:
case TabAlertState::USB_CONNECTED:
case TabAlertState::NONE:
return [self iconColor];
default:
NOTREACHED();
return [self iconColor];
}
}
- (void)accessibilityOptionsDidChange:(id)ignored { - (void)accessibilityOptionsDidChange:(id)ignored {
[self updateAppearance]; [self updateAppearance];
[self setNeedsDisplay:YES]; [self setNeedsDisplay:YES];
......
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