| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/wrench_toolbar_button_cell.h" | 5 #import "chrome/browser/ui/cocoa/toolbar/wrench_toolbar_button_cell.h" |
| 6 | 6 |
| 7 #import "chrome/browser/ui/cocoa/themed_window.h" | 7 #import "chrome/browser/ui/cocoa/themed_window.h" |
| 8 #include "ui/gfx/canvas_skia_paint.h" | 8 #include "ui/gfx/canvas_skia_paint.h" |
| 9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 wrenchIconPainter_->Paint(&canvas, | 54 wrenchIconPainter_->Paint(&canvas, |
| 55 [[controlView window] themeProvider], | 55 [[controlView window] themeProvider], |
| 56 gfx::Rect(NSRectToCGRect(cellFrame)), | 56 gfx::Rect(NSRectToCGRect(cellFrame)), |
| 57 [self currentBezelType]); | 57 [self currentBezelType]); |
| 58 } | 58 } |
| 59 canvas.Restore(); | 59 canvas.Restore(); |
| 60 | 60 |
| 61 [self drawFocusRingWithFrame:cellFrame inView:controlView]; | 61 [self drawFocusRingWithFrame:cellFrame inView:controlView]; |
| 62 } | 62 } |
| 63 | 63 |
| 64 - (void)setSeverity:(WrenchIconPainter::Severity)severity { | 64 - (void)setSeverity:(WrenchIconPainter::Severity)severity |
| 65 wrenchIconPainter_->SetSeverity(severity); | 65 shouldAnimate:(BOOL)shouldAnimate { |
| 66 wrenchIconPainter_->SetSeverity(severity, shouldAnimate); |
| 66 } | 67 } |
| 67 | 68 |
| 68 - (void)commonInit { | 69 - (void)commonInit { |
| 69 delegate_.reset(new WrenchIconPainterDelegateMac(self)); | 70 delegate_.reset(new WrenchIconPainterDelegateMac(self)); |
| 70 wrenchIconPainter_.reset(new WrenchIconPainter(delegate_.get())); | 71 wrenchIconPainter_.reset(new WrenchIconPainter(delegate_.get())); |
| 71 } | 72 } |
| 72 | 73 |
| 73 - (WrenchIconPainter::BezelType)currentBezelType { | 74 - (WrenchIconPainter::BezelType)currentBezelType { |
| 74 if ([self isHighlighted]) | 75 if ([self isHighlighted]) |
| 75 return WrenchIconPainter::BEZEL_PRESSED; | 76 return WrenchIconPainter::BEZEL_PRESSED; |
| 76 if ([self isMouseInside]) | 77 if ([self isMouseInside]) |
| 77 return WrenchIconPainter::BEZEL_HOVER; | 78 return WrenchIconPainter::BEZEL_HOVER; |
| 78 return WrenchIconPainter::BEZEL_NONE; | 79 return WrenchIconPainter::BEZEL_NONE; |
| 79 } | 80 } |
| 80 | 81 |
| 81 @end | 82 @end |
| OLD | NEW |