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 #include "chrome/browser/ui/cocoa/gradient_button_cell.h" | 5 #include "chrome/browser/ui/cocoa/gradient_button_cell.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
11 #import "chrome/browser/themes/theme_properties.h" | 11 #import "chrome/browser/themes/theme_properties.h" |
12 #import "chrome/browser/themes/theme_service.h" | 12 #import "chrome/browser/themes/theme_service.h" |
13 #import "chrome/browser/ui/cocoa/nsview_additions.h" | |
14 #import "chrome/browser/ui/cocoa/rect_path_utils.h" | 13 #import "chrome/browser/ui/cocoa/rect_path_utils.h" |
15 #import "chrome/browser/ui/cocoa/themed_window.h" | 14 #import "chrome/browser/ui/cocoa/themed_window.h" |
16 #include "grit/theme_resources.h" | 15 #include "grit/theme_resources.h" |
17 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSColor+Luminance.h" | 16 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSColor+Luminance.h" |
18 #import "ui/base/cocoa/nsgraphics_context_additions.h" | 17 #import "ui/base/cocoa/nsgraphics_context_additions.h" |
| 18 #import "ui/base/cocoa/nsview_additions.h" |
19 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" | 19 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
20 | 20 |
21 @interface GradientButtonCell (Private) | 21 @interface GradientButtonCell (Private) |
22 - (void)sharedInit; | 22 - (void)sharedInit; |
23 | 23 |
24 // Get drawing parameters for a given cell frame in a given view. The inner | 24 // Get drawing parameters for a given cell frame in a given view. The inner |
25 // frame is the one required by |-drawInteriorWithFrame:inView:|. The inner and | 25 // frame is the one required by |-drawInteriorWithFrame:inView:|. The inner and |
26 // outer paths are the ones required by |-drawBorderAndFillForTheme:...|. The | 26 // outer paths are the ones required by |-drawBorderAndFillForTheme:...|. The |
27 // outer path also gives the area in which to clip. Any of the |return...| | 27 // outer path also gives the area in which to clip. Any of the |return...| |
28 // arguments may be NULL (in which case the given parameter won't be returned). | 28 // arguments may be NULL (in which case the given parameter won't be returned). |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 options:options | 781 options:options |
782 owner:self | 782 owner:self |
783 userInfo:nil]); | 783 userInfo:nil]); |
784 if (isMouseInside_ != mouseInView) { | 784 if (isMouseInside_ != mouseInView) { |
785 [self setMouseInside:mouseInView animate:NO]; | 785 [self setMouseInside:mouseInView animate:NO]; |
786 [controlView setNeedsDisplay:YES]; | 786 [controlView setNeedsDisplay:YES]; |
787 } | 787 } |
788 } | 788 } |
789 | 789 |
790 @end | 790 @end |
OLD | NEW |