Chromium Code Reviews| Index: chrome/browser/ui/cocoa/toolbar/app_toolbar_button_cell.mm |
| diff --git a/chrome/browser/ui/cocoa/toolbar/app_toolbar_button_cell.mm b/chrome/browser/ui/cocoa/toolbar/app_toolbar_button_cell.mm |
| index b59a7e84fb25bfbe5ea562a49c7a1a637ca3567b..43c26ea41ad13d2dee838c2258f6025d9883c853 100644 |
| --- a/chrome/browser/ui/cocoa/toolbar/app_toolbar_button_cell.mm |
| +++ b/chrome/browser/ui/cocoa/toolbar/app_toolbar_button_cell.mm |
| @@ -9,24 +9,8 @@ |
| #include "ui/gfx/canvas_skia_paint.h" |
| #include "ui/gfx/geometry/rect.h" |
| -class AppMenuIconPainterDelegateMac : public AppMenuIconPainter::Delegate { |
| - public: |
| - explicit AppMenuIconPainterDelegateMac(NSCell* cell) : cell_(cell) {} |
| - ~AppMenuIconPainterDelegateMac() override {} |
| - |
| - void ScheduleAppMenuIconPaint() override { |
| - [[cell_ controlView] setNeedsDisplay:YES]; |
| - } |
| - |
| - private: |
| - NSCell* cell_; |
| - |
| - DISALLOW_COPY_AND_ASSIGN(AppMenuIconPainterDelegateMac); |
| -}; |
| - |
| @interface AppToolbarButtonCell () |
| - (void)commonInit; |
| -- (AppMenuIconPainter::BezelType)currentBezelType; |
| @end |
| @implementation AppToolbarButtonCell |
| @@ -50,31 +34,11 @@ class AppMenuIconPainterDelegateMac : public AppMenuIconPainter::Delegate { |
| canvas.set_composite_alpha(true); |
|
Elly Fong-Jones
2016/09/30 11:09:59
The overall effect of this method is now to apply
Evan Stade
2016/09/30 17:20:06
I don't think AppToolbarButtonCell is used or need
|
| canvas.SaveLayerAlpha(255 * |
| [self imageAlphaForWindowState:[controlView window]]); |
| - const ui::ThemeProvider* themeProvider = [[controlView window] themeProvider]; |
| - if (themeProvider) { |
| - iconPainter_->Paint(&canvas, [[controlView window] themeProvider], |
| - gfx::Rect(NSRectToCGRect(cellFrame)), |
| - [self currentBezelType]); |
| - } |
| - canvas.Restore(); |
| -} |
| -- (void)setSeverity:(AppMenuIconPainter::Severity)severity |
| - shouldAnimate:(BOOL)shouldAnimate { |
| - iconPainter_->SetSeverity(severity, shouldAnimate); |
| + canvas.Restore(); |
| } |
| - (void)commonInit { |
| - delegate_.reset(new AppMenuIconPainterDelegateMac(self)); |
| - iconPainter_.reset(new AppMenuIconPainter(delegate_.get())); |
| -} |
| - |
| -- (AppMenuIconPainter::BezelType)currentBezelType { |
| - if ([self isHighlighted]) |
| - return AppMenuIconPainter::BEZEL_PRESSED; |
| - if ([self isMouseInside]) |
| - return AppMenuIconPainter::BEZEL_HOVER; |
| - return AppMenuIconPainter::BEZEL_NONE; |
| } |
| @end |