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

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

Issue 2374803002: Remove a bunch of pre-MD toolbar code and assets. (Closed)
Patch Set: fix mac? 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/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
« no previous file with comments | « chrome/browser/ui/cocoa/toolbar/app_toolbar_button_cell.h ('k') | chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698