OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/image_button_cell.h" | 5 #import "chrome/browser/ui/cocoa/image_button_cell.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #import "chrome/browser/themes/theme_service.h" | 8 #import "chrome/browser/themes/theme_service.h" |
9 #import "chrome/browser/ui/cocoa/nsview_additions.h" | 9 #import "chrome/browser/ui/cocoa/nsview_additions.h" |
10 #import "chrome/browser/ui/cocoa/rect_path_utils.h" | 10 #import "chrome/browser/ui/cocoa/rect_path_utils.h" |
11 #import "chrome/browser/ui/cocoa/themed_window.h" | 11 #import "chrome/browser/ui/cocoa/themed_window.h" |
12 #include "ui/base/resource/resource_bundle.h" | |
13 #include "ui/gfx/image/image.h" | 12 #include "ui/gfx/image/image.h" |
14 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" | 13 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
15 | 14 |
16 // When the window doesn't have focus then we want to draw the button with a | 15 // When the window doesn't have focus then we want to draw the button with a |
17 // slightly lighter color. We do this by just reducing the alpha. | 16 // slightly lighter color. We do this by just reducing the alpha. |
18 const CGFloat kImageNoFocusAlpha = 0.65; | 17 const CGFloat kImageNoFocusAlpha = 0.65; |
19 | 18 |
20 @interface ImageButtonCell (Private) | 19 @interface ImageButtonCell (Private) |
21 - (void)sharedInit; | 20 - (void)sharedInit; |
22 - (image_button_cell::ButtonState)currentButtonState; | 21 - (image_button_cell::ButtonState)currentButtonState; |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 197 |
199 - (void)mouseEntered:(NSEvent*)theEvent { | 198 - (void)mouseEntered:(NSEvent*)theEvent { |
200 [self setIsMouseInside:YES]; | 199 [self setIsMouseInside:YES]; |
201 } | 200 } |
202 | 201 |
203 - (void)mouseExited:(NSEvent*)theEvent { | 202 - (void)mouseExited:(NSEvent*)theEvent { |
204 [self setIsMouseInside:NO]; | 203 [self setIsMouseInside:NO]; |
205 } | 204 } |
206 | 205 |
207 @end | 206 @end |
OLD | NEW |