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

Side by Side Diff: chrome/browser/ui/cocoa/toolbar/wrench_toolbar_button_cell.mm

Issue 14245003: Wrench Icon: Only animate low severity status once (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/toolbar/wrench_toolbar_button_cell.h ('k') | chrome/browser/ui/toolbar/wrench_icon_painter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698