Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.h" | 5 #import "chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.h" |
| 6 | 6 |
| 7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
| 8 #include "base/mac/sdk_forward_declarations.h" | 8 #include "base/mac/sdk_forward_declarations.h" |
| 9 #include "chrome/app/vector_icons/vector_icons.h" | 9 #include "chrome/app/vector_icons/vector_icons.h" |
| 10 #import "chrome/browser/ui/cocoa/image_button_cell.h" | 10 #import "chrome/browser/ui/cocoa/image_button_cell.h" |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 218 case VIEW_ID_APP_MENU: | 218 case VIEW_ID_APP_MENU: |
| 219 return &kBrowserToolsIcon; | 219 return &kBrowserToolsIcon; |
| 220 default: | 220 default: |
| 221 break; | 221 break; |
| 222 } | 222 } |
| 223 | 223 |
| 224 return nullptr; | 224 return nullptr; |
| 225 } | 225 } |
| 226 | 226 |
| 227 - (SkColor)vectorIconColor:(BOOL)themeIsDark { | 227 - (SkColor)vectorIconColor:(BOOL)themeIsDark { |
| 228 return themeIsDark ? SK_ColorWHITE : SkColorSetRGB(0x5A, 0x5A, 0x5A); | 228 const ui::ThemeProvider* provider = [[self window] themeProvider]; |
| 229 return themeIsDark ? SK_ColorWHITE | |
| 230 : provider && provider->ShouldIncreaseContrast() | |
|
Mark Mentovai
2017/02/23 01:54:16
Same.
Elly Fong-Jones
2017/02/23 17:19:42
Done.
| |
| 231 ? SK_ColorBLACK | |
| 232 : SkColorSetRGB(0x5A, 0x5A, 0x5A); | |
| 229 } | 233 } |
| 230 | 234 |
| 231 - (NSImage*)browserToolsIconForFillColor:(SkColor)fillColor { | 235 - (NSImage*)browserToolsIconForFillColor:(SkColor)fillColor { |
| 232 // Create a |BrowserToolsImageRep| to draw the browser tools icon using | 236 // Create a |BrowserToolsImageRep| to draw the browser tools icon using |
| 233 // the provided fill color. | 237 // the provided fill color. |
| 234 base::scoped_nsobject<BrowserToolsImageRep> imageRep( | 238 base::scoped_nsobject<BrowserToolsImageRep> imageRep( |
| 235 [[BrowserToolsImageRep alloc] | 239 [[BrowserToolsImageRep alloc] |
| 236 initWithDrawSelector:@selector(drawBrowserToolsIcon:) | 240 initWithDrawSelector:@selector(drawBrowserToolsIcon:) |
| 237 delegate:[BrowserToolsImageRep class]]); | 241 delegate:[BrowserToolsImageRep class]]); |
| 238 [imageRep setFillColor:skia::SkColorToSRGBNSColor(fillColor)]; | 242 [imageRep setFillColor:skia::SkColorToSRGBNSColor(fillColor)]; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 378 | 382 |
| 379 - (void)windowDidChangeTheme { | 383 - (void)windowDidChangeTheme { |
| 380 // Update the hover and pressed image backgrounds to match the current theme. | 384 // Update the hover and pressed image backgrounds to match the current theme. |
| 381 [self resetButtonStateImages]; | 385 [self resetButtonStateImages]; |
| 382 } | 386 } |
| 383 | 387 |
| 384 - (void)windowDidChangeActive { | 388 - (void)windowDidChangeActive { |
| 385 } | 389 } |
| 386 | 390 |
| 387 @end | 391 @end |
| OLD | NEW |