OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/hover_close_button.h" | 5 #import "chrome/browser/ui/cocoa/hover_close_button.h" |
6 | 6 |
7 #include "base/memory/scoped_nsobject.h" | 7 #include "base/memory/scoped_nsobject.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #import "chrome/browser/ui/cocoa/animation_utils.h" | 9 #import "chrome/browser/ui/cocoa/animation_utils.h" |
10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 break; | 153 break; |
154 } | 154 } |
155 } | 155 } |
156 } | 156 } |
157 | 157 |
158 - (void)setFadeOutValue:(CGFloat)value { | 158 - (void)setFadeOutValue:(CGFloat)value { |
159 [self setNeedsDisplay]; | 159 [self setNeedsDisplay]; |
160 } | 160 } |
161 | 161 |
162 - (NSImage*)imageForHoverState:(HoverState)hoverState { | 162 - (NSImage*)imageForHoverState:(HoverState)hoverState { |
163 int imageID = IDR_TAB_CLOSE; | 163 int imageID = IDR_CLOSE_1; |
164 switch (hoverState) { | 164 switch (hoverState) { |
165 case kHoverStateNone: | 165 case kHoverStateNone: |
166 imageID = IDR_TAB_CLOSE; | 166 imageID = IDR_CLOSE_1; |
167 break; | 167 break; |
168 case kHoverStateMouseOver: | 168 case kHoverStateMouseOver: |
169 imageID = IDR_TAB_CLOSE_H; | 169 imageID = IDR_CLOSE_1_H; |
170 break; | 170 break; |
171 case kHoverStateMouseDown: | 171 case kHoverStateMouseDown: |
172 imageID = IDR_TAB_CLOSE_P; | 172 imageID = IDR_CLOSE_1_P; |
173 break; | 173 break; |
174 } | 174 } |
175 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 175 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
176 return bundle.GetNativeImageNamed(imageID).ToNSImage(); | 176 return bundle.GetNativeImageNamed(imageID).ToNSImage(); |
177 } | 177 } |
178 | 178 |
179 - (void)setHoverState:(HoverState)state { | 179 - (void)setHoverState:(HoverState)state { |
180 if (state != self.hoverState) { | 180 if (state != self.hoverState) { |
181 previousState_ = self.hoverState; | 181 previousState_ = self.hoverState; |
182 [super setHoverState:state]; | 182 [super setHoverState:state]; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 break; | 246 break; |
247 case kHoverStateMouseDown: | 247 case kHoverStateMouseDown: |
248 imageID = IDR_CLOSE_DIALOG_P; | 248 imageID = IDR_CLOSE_DIALOG_P; |
249 break; | 249 break; |
250 } | 250 } |
251 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 251 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
252 return bundle.GetNativeImageNamed(imageID).ToNSImage(); | 252 return bundle.GetNativeImageNamed(imageID).ToNSImage(); |
253 } | 253 } |
254 | 254 |
255 @end | 255 @end |
OLD | NEW |