| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/cocoa/hover_close_button.h" | 5 #import "chrome/browser/cocoa/hover_close_button.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/nsimage_cache_mac.h" | 8 #include "base/nsimage_cache_mac.h" |
| 9 #include "grit/generated_resources.h" | 9 #include "grit/generated_resources.h" |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 const NSString* kNormalImageString = @"close_bar.pdf"; | 13 NSString* const kNormalImageString = @"close_bar.pdf"; |
| 14 const NSString* kHoverImageString = @"close_bar_h.pdf"; | 14 NSString* const kHoverImageString = @"close_bar_h.pdf"; |
| 15 const NSString* kPressedImageString = @"close_bar_p.pdf"; | 15 NSString* const kPressedImageString = @"close_bar_p.pdf"; |
| 16 | 16 |
| 17 } | 17 } // namespace |
| 18 | 18 |
| 19 @implementation HoverCloseButton | 19 @implementation HoverCloseButton |
| 20 | 20 |
| 21 - (id)initWithFrame:(NSRect)frameRect { | 21 - (id)initWithFrame:(NSRect)frameRect { |
| 22 if ((self = [super initWithFrame:frameRect])) { | 22 if ((self = [super initWithFrame:frameRect])) { |
| 23 [self commonInit]; | 23 [self commonInit]; |
| 24 } | 24 } |
| 25 return self; | 25 return self; |
| 26 } | 26 } |
| 27 | 27 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 kHoverImageString : kNormalImageString; | 108 kHoverImageString : kNormalImageString; |
| 109 NSImage* newImage = nsimage_cache::ImageNamed(name); | 109 NSImage* newImage = nsimage_cache::ImageNamed(name); |
| 110 NSImage* buttonImage = [self image]; | 110 NSImage* buttonImage = [self image]; |
| 111 if (![buttonImage isEqual:newImage]) { | 111 if (![buttonImage isEqual:newImage]) { |
| 112 [self setImage:newImage]; | 112 [self setImage:newImage]; |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 | 116 |
| 117 @end | 117 @end |
| OLD | NEW |