Skip to content

Commit

Permalink
Revert of [Mac][Material Design] Bring Omnibox stroke and MD colors u…
Browse files Browse the repository at this point in the history
…p to spec. (patchset #1 id:1 of https://codereview.chromium.org/2032143004/ )

Reason for revert:
Broke the continuous build because of a missing symbol.

https://chromegw.corp.google.com/i/official.desktop.continuous/builders/mac%20beta/builds/3236/steps/compile/logs/stdio

FAILED: obj/chrome/browser/ui/cocoa/location_bar/browser_ui.location_bar_view_mac.o
../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/chrome/browser/ui/cocoa/location_bar/browser_ui.location_bar_view_mac.o.d -DV8_DEPRECATION_WARNINGS -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0 -DGOOGLE_CHROME_BUILD -DCR_CLANG_REVISION=269902-1 -DENABLE_RLZ -DUSE_LIBJPEG_TURBO=1 -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DUSE_PROPRIETARY_CODECS -DENABLE_PEPPER_CDMS -DENABLE_NOTIFICATIONS -DENABLE_TOPCHROME_MD=1 -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PDF=1 -DENABLE_PLUGIN_INSTALLATION=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_PROD_WALLET_SERVICE=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DUSE_BROWSER_SPELLCHECKER=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_SERVICE_DISCOVERY=1 -DENABLE_HANGOUT_SERVICES_EXTENSION=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DMOJO_USE_SYSTEM_IMPL -DTOOLKIT_VIEWS=1 -DPROTOBUF_USE_DLLS -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DSK_SUPPORT_GPU=1 -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DU_NOEXCEPT= -DU_STATIC_IMPLEMENTATION -DUSE_CUPS '-DI18N_ADDRESS_VALIDATION_DATA_URL="https://i18napis.appspot.com/ssl-aggregate-address/"' -DI18N_ADDRESSINPUT_USE_BASICTYPES_OVERRIDE=1 -DUSE_LIBPCI=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DOFFICIAL_BUILD -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_FORTIFY_SOURCE=2 -Igen -I../.. -Iobj/chrome/browser_ui.gen -Iobj/chrome/browser_ui.gen/chrome -I../../skia/config -I../../third_party/khronos -I../../gpu -Igen/angle -I../../third_party/WebKit/Source -Igen/chrome -Igen/protoc_out -I../../third_party/protobuf/src -I../../third_party/dom_distiller_js/dist/proto_gen -Igen/policy -Igen/components -Igen/components/strings -I../../third_party/WebKit -Igen/third_party/WebKit -I../../third_party/skia/include/core -I../../third_party/skia/include/effects -I../../third_party/skia/include/pdf -I../../third_party/skia/include/gpu -I../../third_party/skia/include/lazy -I../../third_party/skia/include/pathops -I../../third_party/skia/include/pipe -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../third_party/skia/include/utils/mac -I../../skia/ext -I../../third_party/cacheinvalidation/overrides -I../../third_party/cacheinvalidation/src -I../../third_party/cacheinvalidation/google/cacheinvalidation -I../../third_party/icu/source/i18n -I../../third_party/icu/source/common -I../../third_party/zlib -Igen/ui/resources -Igen/content/app/resources/ -I../../third_party/libwebm/source -I../../third_party/opus/src/include -I../../third_party/leveldatabase/src/include -I../../third_party/leveldatabase/src -I../../third_party/leveldatabase -I../../third_party/re2/src -I../../v8/include -I../../third_party/google_toolbox_for_mac -I../../third_party/google_toolbox_for_mac/src -I../../third_party/google_toolbox_for_mac/src/AppKit -I../../third_party/google_toolbox_for_mac/src/DebugUtils -I../../third_party/google_toolbox_for_mac/src/Foundation -Igen/ui/views/resources -I../../third_party/libaddressinput/chromium/override -I../../third_party/libaddressinput/src/cpp/include -Igen/third_party/libaddressinput/ -isysroot /Applications/Xcode5.1.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -O2 -gdwarf-2 -fvisibility=hidden -Werror -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-selector-type-mismatch -Wpartial-availability -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-undefined-var-template -Wno-nonnull -Wexit-time-destructors -std=c++11 -stdlib=libc++ -fno-rtti -fno-exceptions -fvisibility-inlines-hidden -fno-threadsafe-statics -Xclang -load -Xclang /b/build/slave/mac_beta/build/src/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-templates -Xclang -plugin-arg-find-bad-constructs -Xclang follow-macro-expansion -Xclang -plugin-arg-find-bad-constructs -Xclang check-implicit-copy-ctors -fcolor-diagnostics -fno-strict-aliasing -fno-standalone-debug -Wobjc-missing-property-synthesis -fobjc-call-cxx-cdtors  -c ../../chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm -o obj/chrome/browser/ui/cocoa/location_bar/browser_ui.location_bar_view_mac.o
../../chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm:583:29: error: no member named 'GetSecureTextColor' in 'OmniboxViewMac'
            OmniboxViewMac::GetSecureTextColor(security_level, in_dark_mode);
            ~~~~~~~~~~~~~~~~^

Original issue's description:
> [Mac][Material Design] Bring Omnibox stroke and MD colors up to spec.
>
> This cl changes the Omnibox's stroke in Incognito mode to match the
> recent spec revisions made by sgabriel@.
>
> Changing to the new spec also required switching other MD colors to the
> sRGB color space so that everything matched. The plan was to switch to
> sRGB (which is correct - the calibrated space is not) eventually, but
> to get the Omnibox to look right, now is the time.
>
> [email protected],[email protected]
> BUG=613749
>
> Review-Url: https://codereview.chromium.org/2013183003
> Cr-Commit-Position: refs/heads/master@{#396986}
> (cherry picked from commit 7a7f2e3)
>
> Committed: https://chromium.googlesource.com/chromium/src/+/793018247051e845ad6754e0344f5f892349237f

[email protected],[email protected]
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=613749

Review-Url: https://codereview.chromium.org/2035153002
Cr-Commit-Position: refs/branch-heads/2743@{crosswalk-project#208}
Cr-Branched-From: 2b3ae3b-refs/heads/master@{#394939}
  • Loading branch information
shrike authored and Commit bot committed Jun 3, 2016
1 parent 7930182 commit 54bda71
Show file tree
Hide file tree
Showing 11 changed files with 152 additions and 75 deletions.
10 changes: 2 additions & 8 deletions chrome/browser/themes/theme_service_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ void HSLToHSB(const color_utils::HSL& hsl, CGFloat* h, CGFloat* s, CGFloat* b) {
DCHECK(CalledOnValidThread());

int original_id = id;
const bool is_mode_material = ui::MaterialDesignController::IsModeMaterial();
if (is_mode_material && incognito) {
if (ui::MaterialDesignController::IsModeMaterial() && incognito) {
id += kMaterialDesignIdOffset;
}

Expand All @@ -194,12 +193,7 @@ void HSLToHSB(const color_utils::HSL& hsl, CGFloat* h, CGFloat* s, CGFloat* b) {
return nscolor_iter->second;

SkColor sk_color = GetColor(original_id, incognito);
NSColor* color = nil;
if (is_mode_material) {
color = skia::SkColorToSRGBNSColor(sk_color);
} else {
color = skia::SkColorToCalibratedNSColor(sk_color);
}
NSColor* color = skia::SkColorToCalibratedNSColor(sk_color);

// We loaded successfully. Cache the color.
if (color)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,16 @@ class AutocompleteTextFieldObserver {

base::scoped_nsobject<NSString> suggestText_;
base::scoped_nsobject<NSColor> suggestColor_;

base::scoped_nsobject<NSView> shadowView_;
}

@property(nonatomic) AutocompleteTextFieldObserver* observer;

// Returns the color of the shadow that's drawn under the AutocompleteTextField
// in Incognito mode in Material Design.
+ (NSColor*)shadowColor;

// Convenience method to return the cell, casted appropriately.
- (AutocompleteTextFieldCell*)cell;

Expand Down
86 changes: 83 additions & 3 deletions chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,79 @@

namespace {
const CGFloat kAnimationDuration = 0.2;
const CGFloat kShadowInset = 3;

}

// A view that draws a 1px shadow line beneath the autocomplete textfield.
@interface AutocompleteTextFieldShadowView : NSView {
@private
AutocompleteTextField* textField_; // Weak. Owns this.
}
// This is the designated initializer for AutocompleteTextFieldShadowView.
- (instancetype)initWithTextField:(AutocompleteTextField*)aTextField;
@end

@interface AutocompleteTextFieldShadowView(Private)
// Adjusts the shadow view's position whenever its AutocompleteTextField changes
// its frame.
- (void)adjustFrame;
@end

@implementation AutocompleteTextFieldShadowView

- (instancetype)initWithTextField:(AutocompleteTextField*)aTextField {
if ((self = [self initWithFrame:NSZeroRect])) {
textField_ = aTextField;
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(adjustFrame)
name:NSViewFrameDidChangeNotification
object:textField_];
}
return self;
}

- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
}

- (void)adjustFrame {
if (![self window]) {
return;
}
// Make the shadow view 1pt tall and slightly inset from the edges of the
// autocomplete textfield.
NSRect frame = [textField_ frame];
frame.origin.x += kShadowInset;
frame.size.width -= kShadowInset * 2;
frame.origin.y -= 1;
frame.size.height = 1;
[self setFrame:frame];
}

- (void)viewDidMoveToWindow {
[self adjustFrame];
}

- (void)drawRect:(NSRect)rect {
// Don't draw anything on a Retina display because on Retina there's room
// for the shadow just beneath the autocomplete textfield path stroke. Why
// even add this view? If the user drags the Incognito window between Retina
// and non-Retina screens there would have to be logic to add and remove the
// view. It's easier just to always add it for Incognito mode and draw
// nothing into it.
if (![[self window] inIncognitoModeWithSystemTheme] ||
[self cr_lineWidth] < 1) {
return;
}
[[AutocompleteTextField shadowColor] set];
NSRectFillUsingOperation(rect, NSCompositeSourceOver);
}

@end

@implementation AutocompleteTextField

@synthesize observer = observer_;
Expand All @@ -33,8 +103,13 @@ + (Class)cellClass {
return [AutocompleteTextFieldCell class];
}

+ (NSColor*)shadowColor {
return [NSColor colorWithGenericGamma22White:0 alpha:0.14];
}

- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[shadowView_ removeFromSuperview];
[super dealloc];
}

Expand Down Expand Up @@ -386,16 +461,16 @@ - (void)updateColorsToMatchTheme {
// Invert the textfield's colors when Material Design and Incognito and not
// a custom theme.
bool inDarkMode = [[self window] inIncognitoModeWithSystemTheme];
const CGFloat kDarkModeGray = 97 / 255.;
[self setBackgroundColor:
inDarkMode ? [NSColor colorWithGenericGamma22White:kDarkModeGray
alpha:1]
inDarkMode ? [NSColor colorWithGenericGamma22White:115 / 255. alpha:1]
: [NSColor whiteColor]];
[self setTextColor:OmniboxViewMac::BaseTextColor(inDarkMode)];
}

- (void)viewDidMoveToWindow {
if (![self window]) {
[shadowView_ removeFromSuperview];
shadowView_.reset();
return;
}

Expand All @@ -406,6 +481,11 @@ - (void)viewDidMoveToWindow {
[BrowserWindowController browserWindowControllerForView:self];
[[browserWindowController toolbarController] locationBarWasAddedToWindow];

// Add a 1px shadow below the autocomplete textfield.
shadowView_.reset(
[[AutocompleteTextFieldShadowView alloc] initWithTextField:self]);
[[self superview] addSubview:shadowView_];

[self updateColorsToMatchTheme];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,56 @@ - (void)drawWithFrame:(NSRect)frame inView:(NSView*)controlView {
// Draw the border.
if (isModeMaterial) {
if (!inDarkMode) {
const CGFloat kNormalStrokeGray = 168 / 255.;
[[NSColor colorWithCalibratedWhite:kNormalStrokeGray alpha:1] set];
[[NSColor colorWithCalibratedWhite:168 / 255. alpha:1] set];
[path stroke];
} else {
const CGFloat k30PercentAlpha = 0.3;
[[NSColor colorWithCalibratedWhite:0 alpha:k30PercentAlpha] set];
// In dark mode the top, middle, and bottom portions of the stroke are
// drawn in different colors.
{
gfx::ScopedNSGraphicsContextSaveGState saveState;
[[NSColor colorWithCalibratedWhite:52 / 255. alpha:1] set];
[NSBezierPath clipRect:NSMakeRect(NSMinX(frame), NSMaxY(frame) - 2,
NSWidth(frame), 2)];
[path stroke];
}
{
gfx::ScopedNSGraphicsContextSaveGState saveState;
[[NSColor colorWithCalibratedWhite:61 / 255. alpha:1] set];
[NSBezierPath clipRect:NSMakeRect(NSMinX(frame), NSMinY(frame) + 3,
NSWidth(frame), NSHeight(frame) - 5)];
[path stroke];
}
{
gfx::ScopedNSGraphicsContextSaveGState saveState;
[[NSColor colorWithCalibratedWhite:71 / 255. alpha:1] set];
[NSBezierPath clipRect:NSMakeRect(NSMinX(frame), NSMinY(frame),
NSWidth(frame), 3)];
[path stroke];
}

// Draw a highlight beneath the top edge, and a shadow beneath the bottom
// edge when on a Retina screen.
{
gfx::ScopedNSGraphicsContextSaveGState saveState;
[NSBezierPath setDefaultLineWidth:singlePixelLineWidth_];

[[NSColor colorWithCalibratedWhite:120 / 255. alpha:1] set];
NSPoint origin = NSMakePoint(NSMinX(pathRect) + 3,
NSMinY(pathRect) + singlePixelLineWidth_);
NSPoint destination =
NSMakePoint(NSMaxX(pathRect) - 3,
NSMinY(pathRect) + singlePixelLineWidth_);
[NSBezierPath strokeLineFromPoint:origin
toPoint:destination];

if (singlePixelLineWidth_ < 1) {
origin.y = destination.y = NSMaxY(pathRect) + singlePixelLineWidth_;
[[AutocompleteTextField shadowColor] set];
[NSBezierPath strokeLineFromPoint:origin
toPoint:destination];
}
}
}
[path stroke];
} else {
ui::DrawNinePartImage(frame,
isPopupMode_ ? kPopupBorderImageIds
Expand Down
20 changes: 0 additions & 20 deletions chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm
Original file line number Diff line number Diff line change
Expand Up @@ -100,26 +100,6 @@ CGFloat BubblePadding() {
textOffset = NSMaxX(imageRect) + kIconLabelPadding;
}

// Draw the divider and set the text color.
if (ui::MaterialDesignController::IsModeMaterial()) {
NSBezierPath* line = [NSBezierPath bezierPath];
[line setLineWidth:1];
[line moveToPoint:NSMakePoint(NSMaxX(decoration_frame) - DividerPadding(),
NSMinY(decoration_frame))];
[line lineToPoint:NSMakePoint(NSMaxX(decoration_frame) - DividerPadding(),
NSMaxY(decoration_frame))];

bool in_dark_mode = [[control_view window] inIncognitoModeWithSystemTheme];
[GetDividerColor(in_dark_mode) set];
[line stroke];

NSColor* text_color =
in_dark_mode
? skia::SkColorToSRGBNSColor(kMaterialDarkModeTextColor)
: GetBackgroundBorderColor();
SetTextColor(text_color);
}

if (label_) {
NSRect textRect = frame;
textRect.origin.x = textOffset;
Expand Down
12 changes: 1 addition & 11 deletions chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -574,17 +574,7 @@ new ManagePasswordsDecoration(command_updater, this)),
if (in_dark_mode) {
vector_icon_color = SK_ColorWHITE;
} else {
security_state::SecurityStateModel::SecurityLevel security_level =
GetToolbarModel()->GetSecurityLevel(false);
if (security_level == security_state::SecurityStateModel::NONE) {
vector_icon_color = OmniboxViewMac::BaseTextColorSkia(in_dark_mode);
} else {
NSColor* sRGBColor =
OmniboxViewMac::GetSecureTextColor(security_level, in_dark_mode);
NSColor* deviceColor =
[sRGBColor colorUsingColorSpace:[NSColorSpace deviceRGBColorSpace]];
vector_icon_color = skia::NSDeviceColorToSkColor(deviceColor);
}
vector_icon_color = OmniboxViewMac::BaseTextColorSkia(in_dark_mode);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@
SelectedKeywordDecoration::~SelectedKeywordDecoration() {}

NSColor* SelectedKeywordDecoration::GetBackgroundBorderColor() {
if (!ui::MaterialDesignController::IsModeMaterial()) {
return skia::SkColorToCalibratedNSColor(gfx::kGoogleBlue700);
}
return skia::SkColorToSRGBNSColor(gfx::kGoogleBlue700);
return skia::SkColorToCalibratedNSColor(gfx::kGoogleBlue700);
}

CGFloat SelectedKeywordDecoration::GetWidthForSpace(CGFloat width) {
Expand Down
10 changes: 2 additions & 8 deletions chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,10 @@ NSRect FlipIfRTL(NSRect rect, NSRect frame) {
return skia::SkColorToSRGBNSColor(SkColorSetRGB(0x64, 0x64, 0x64));
}
NSColor* PositiveTextColor() {
if (!ui::MaterialDesignController::IsModeMaterial()) {
return skia::SkColorToCalibratedNSColor(SkColorSetRGB(0x3d, 0x94, 0x00));
}
return skia::SkColorToSRGBNSColor(SkColorSetRGB(0x3d, 0x94, 0x00));
return skia::SkColorToCalibratedNSColor(SkColorSetRGB(0x3d, 0x94, 0x00));
}
NSColor* NegativeTextColor() {
if (!ui::MaterialDesignController::IsModeMaterial()) {
return skia::SkColorToCalibratedNSColor(SkColorSetRGB(0xdd, 0x4b, 0x39));
}
return skia::SkColorToSRGBNSColor(SkColorSetRGB(0xdd, 0x4b, 0x39));
return skia::SkColorToCalibratedNSColor(SkColorSetRGB(0xdd, 0x4b, 0x39));
}
NSColor* URLTextColor(BOOL is_dark_theme) {
if (!ui::MaterialDesignController::IsModeMaterial()) {
Expand Down
17 changes: 7 additions & 10 deletions chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,19 @@
if (!ui::MaterialDesignController::IsModeMaterial()) {
return ColorWithRGBBytes(0x07, 0x95, 0x00);
}
return in_dark_mode
? skia::SkColorToSRGBNSColor(SkColorSetA(SK_ColorWHITE, 0x7F))
: skia::SkColorToSRGBNSColor(gfx::kGoogleGreen700);
return in_dark_mode ? [NSColor colorWithCalibratedWhite:1 alpha:0.5]
: skia::SkColorToCalibratedNSColor(gfx::kGoogleGreen700);
}
NSColor* SecurityWarningSchemeColor(bool in_dark_mode) {
return in_dark_mode
? skia::SkColorToSRGBNSColor(SkColorSetA(SK_ColorWHITE, 0x7F))
: skia::SkColorToSRGBNSColor(gfx::kGoogleYellow700);
return in_dark_mode ? [NSColor colorWithCalibratedWhite:1 alpha:0.5]
: skia::SkColorToCalibratedNSColor(gfx::kGoogleYellow700);
}
NSColor* SecurityErrorSchemeColor(bool in_dark_mode) {
if (!ui::MaterialDesignController::IsModeMaterial()) {
return ColorWithRGBBytes(0xa2, 0x00, 0x00);
}
return in_dark_mode
? skia::SkColorToSRGBNSColor(SkColorSetA(SK_ColorWHITE, 0x7F))
: skia::SkColorToSRGBNSColor(gfx::kGoogleRed700);
return in_dark_mode ? [NSColor colorWithCalibratedWhite:1 alpha:0.5]
: skia::SkColorToCalibratedNSColor(gfx::kGoogleRed700);
}

const char kOmniboxViewMacStateKey[] = "OmniboxViewMacState";
Expand Down Expand Up @@ -175,7 +172,7 @@ NSRange ComponentToNSRange(const url::Component& component) {
if (!ui::MaterialDesignController::IsModeMaterial()) {
return [NSColor darkGrayColor];
}
return skia::SkColorToSRGBNSColor(BaseTextColorSkia(in_dark_mode));
return skia::SkColorToCalibratedNSColor(BaseTextColorSkia(in_dark_mode));
}

OmniboxViewMac::OmniboxViewMac(OmniboxEditController* controller,
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/ui/cocoa/tabs/tab_view.mm
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ + (NSBezierPath*)tabLeftEdgeBezierPathForContext:(CGContextRef)context {

+ (void)setTabEdgeStrokeColor {
static NSColor* strokeColor =
[skia::SkColorToSRGBNSColor(SkColorSetARGB(76, 0, 0, 0)) retain];
[skia::SkColorToCalibratedNSColor(SkColorSetARGB(76, 0, 0, 0)) retain];
[strokeColor set];
}

Expand Down
6 changes: 1 addition & 5 deletions chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,7 @@ - (NSImage*)browserToolsIconForFillColor:(SkColor)fillColor {
[[BrowserToolsImageRep alloc]
initWithDrawSelector:@selector(drawBrowserToolsIcon:)
delegate:[BrowserToolsImageRep class]];
if (!ui::MaterialDesignController::IsModeMaterial()) {
[imageRep setFillColor:skia::SkColorToCalibratedNSColor(fillColor)];
} else {
[imageRep setFillColor:skia::SkColorToSRGBNSColor(fillColor)];
}
[imageRep setFillColor:skia::SkColorToCalibratedNSColor(fillColor)];

// Create the image from the image rep.
NSImage* browserToolsIcon =
Expand Down

0 comments on commit 54bda71

Please sign in to comment.