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

Unified Diff: chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm

Issue 2361153002: cocoa browser: remove non-material toolbar support (Closed)
Patch Set: Created 4 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/cocoa/toolbar/toolbar_button_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm b/chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm
index b5c54fafd59adbccfd1223c35bc5f9573f2be763..0693a2e220d43b5538dbc7f8407d9e2972d83615 100644
--- a/chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm
+++ b/chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm
@@ -153,10 +153,6 @@ @implementation ToolbarButton
@synthesize handleMiddleClick = handleMiddleClick_;
+ (NSSize)toolbarButtonSize {
- if (!ui::MaterialDesignController::IsModeMaterial()) {
- return NSMakeSize(29, 29);
- }
-
return kMDButtonBounds.size;
}
@@ -235,11 +231,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::SkColorToSRGBNSColor(fillColor)];
// Create the image from the image rep.
NSImage* browserToolsIcon =
@@ -271,19 +263,11 @@ - (NSImage*)imageForIcon:(NSImage*)iconImage
}
- (NSImage*)image {
- if (!ui::MaterialDesignController::IsModeMaterial()) {
- return [super image];
- }
// setImage: stores the image in an ivar.
return image_.get();
}
- (void)setImage:(NSImage*)anImage {
- if (!ui::MaterialDesignController::IsModeMaterial()) {
- [super setImage:anImage];
- return;
- }
-
// We want to set the default image as the image for kDefaultState. Setting it
// as the default image (via setImage:) can cause ghosting from the two
// default images being drawn over each other. However we also need to keep
@@ -294,8 +278,6 @@ - (void)setImage:(NSImage*)anImage {
}
- (void)resetButtonStateImages {
- DCHECK(ui::MaterialDesignController::IsModeMaterial());
-
NSImage* normalIcon = nil;
NSImage* disabledIcon = nil;
BOOL isDarkTheme = NO;
@@ -383,7 +365,7 @@ - (void)viewDidMoveToWindow {
// In Material Design we want to catch when the button is attached to its
// window so that we can configure its appearance based on the window's
// theme.
- if ([self window] && ui::MaterialDesignController::IsModeMaterial()) {
+ if ([self window]) {
[self resetButtonStateImages];
}
}
@@ -392,9 +374,7 @@ - (void)viewDidMoveToWindow {
- (void)windowDidChangeTheme {
// Update the hover and pressed image backgrounds to match the current theme.
- if (ui::MaterialDesignController::IsModeMaterial()) {
- [self resetButtonStateImages];
- }
+ [self resetButtonStateImages];
}
- (void)windowDidChangeActive {

Powered by Google App Engine
This is Rietveld 408576698