OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2010, 2011, 2012 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008, 2010, 2011, 2012 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 12 matching lines...) Expand all Loading... |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #import "config.h" | 26 #import "config.h" |
27 #import "platform/mac/ThemeMac.h" | 27 #import "platform/mac/ThemeMac.h" |
28 | 28 |
29 #import <Carbon/Carbon.h> | 29 #import <Carbon/Carbon.h> |
30 #import "platform/graphics/GraphicsContextStateSaver.h" | 30 #import "platform/graphics/GraphicsContextStateSaver.h" |
31 #import "platform/mac/BlockExceptions.h" | 31 #import "platform/mac/BlockExceptions.h" |
32 #import "platform/mac/LocalCurrentGraphicsContext.h" | 32 #import "platform/mac/LocalCurrentGraphicsContext.h" |
| 33 #import "platform/mac/VersionUtilMac.h" |
33 #import "platform/mac/WebCoreNSCellExtras.h" | 34 #import "platform/mac/WebCoreNSCellExtras.h" |
34 #import "platform/scroll/ScrollableArea.h" | 35 #import "platform/scroll/ScrollableArea.h" |
35 #include "wtf/StdLibExtras.h" | 36 #include "wtf/StdLibExtras.h" |
36 | 37 |
37 // This is a view whose sole purpose is to tell AppKit that it's flipped. | 38 // This is a view whose sole purpose is to tell AppKit that it's flipped. |
38 @interface WebCoreFlippedView : NSControl | 39 @interface WebCoreFlippedView : NSControl |
39 @end | 40 @end |
40 | 41 |
41 @implementation WebCoreFlippedView | 42 @implementation WebCoreFlippedView |
42 | 43 |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 paintButton(part, states, context, zoomedRect, zoomFactor, scrollabl
eArea); | 690 paintButton(part, states, context, zoomedRect, zoomFactor, scrollabl
eArea); |
690 break; | 691 break; |
691 case InnerSpinButtonPart: | 692 case InnerSpinButtonPart: |
692 paintStepper(states, context, zoomedRect, zoomFactor, scrollableArea
); | 693 paintStepper(states, context, zoomedRect, zoomFactor, scrollableArea
); |
693 break; | 694 break; |
694 default: | 695 default: |
695 break; | 696 break; |
696 } | 697 } |
697 } | 698 } |
698 | 699 |
699 #ifndef NSAppKitVersionNumber10_7 | |
700 #define NSAppKitVersionNumber10_7 1138 | |
701 #endif | |
702 #ifndef NSAppKitVersionNumber10_9 | |
703 #define NSAppKitVersionNumber10_9 1265 | |
704 #endif | |
705 | |
706 bool ThemeMac::drawWithFrameDrawsFocusRing() | 700 bool ThemeMac::drawWithFrameDrawsFocusRing() |
707 { | 701 { |
708 #if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_V
ERSION_10_8 | 702 #if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_V
ERSION_10_8 |
709 // If compiling against an OSX 10.8+ SDK, only 10.7 and older OSes will draw a | 703 // If compiling against an OSX 10.8+ SDK, only 10.7 and older OSes will draw a |
710 // focus ring with the frame. | 704 // focus ring with the frame. |
711 return floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_7; | 705 return IsOSLionOrEarlier(); |
712 #else | 706 #else |
713 // If compiling an OSX 10.7 or older SDK, OSes up through 10.9 will draw a focus | 707 // If compiling an OSX 10.7 or older SDK, OSes up through 10.9 will draw a focus |
714 // ring with the frame. | 708 // ring with the frame. |
715 return floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_9; | 709 return IsOSMavericksOrEarlier(); |
716 #endif | 710 #endif |
717 } | 711 } |
718 | 712 |
719 } | 713 } |
OLD | NEW |