| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 return nil; | 50 return nil; |
| 51 } | 51 } |
| 52 | 52 |
| 53 - (BOOL)_automaticFocusRingDisabled | 53 - (BOOL)_automaticFocusRingDisabled |
| 54 { | 54 { |
| 55 return YES; | 55 return YES; |
| 56 } | 56 } |
| 57 | 57 |
| 58 @end | 58 @end |
| 59 | 59 |
| 60 @implementation NSFont (WebCoreTheme) | |
| 61 | |
| 62 - (NSString*)webCoreFamilyName | |
| 63 { | |
| 64 if ([[self familyName] hasPrefix:@"."]) | |
| 65 return [self fontName]; | |
| 66 | |
| 67 return [self familyName]; | |
| 68 } | |
| 69 | |
| 70 @end | |
| 71 | |
| 72 namespace blink { | 60 namespace blink { |
| 73 | 61 |
| 74 Theme* platformTheme() | 62 Theme* platformTheme() |
| 75 { | 63 { |
| 76 DEFINE_STATIC_LOCAL(ThemeMac, themeMac, ()); | 64 DEFINE_STATIC_LOCAL(ThemeMac, themeMac, ()); |
| 77 return &themeMac; | 65 return &themeMac; |
| 78 } | 66 } |
| 79 | 67 |
| 80 // Helper functions used by a bunch of different control parts. | 68 // Helper functions used by a bunch of different control parts. |
| 81 | 69 |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 | 539 |
| 552 FontDescription ThemeMac::controlFont(ControlPart part, const FontDescription& f
ontDescription, float zoomFactor) const | 540 FontDescription ThemeMac::controlFont(ControlPart part, const FontDescription& f
ontDescription, float zoomFactor) const |
| 553 { | 541 { |
| 554 switch (part) { | 542 switch (part) { |
| 555 case PushButtonPart: { | 543 case PushButtonPart: { |
| 556 FontDescription result; | 544 FontDescription result; |
| 557 result.setIsAbsoluteSize(true); | 545 result.setIsAbsoluteSize(true); |
| 558 result.setGenericFamily(FontDescription::SerifFamily); | 546 result.setGenericFamily(FontDescription::SerifFamily); |
| 559 | 547 |
| 560 NSFont* nsFont = [NSFont systemFontOfSize:[NSFont systemFontSizeForC
ontrolSize:controlSizeForFont(fontDescription)]]; | 548 NSFont* nsFont = [NSFont systemFontOfSize:[NSFont systemFontSizeForC
ontrolSize:controlSizeForFont(fontDescription)]]; |
| 561 result.firstFamily().setFamily([nsFont webCoreFamilyName]); | 549 result.firstFamily().setFamily(@"BlinkMacSystemFont"); |
| 562 result.setComputedSize([nsFont pointSize] * zoomFactor); | 550 result.setComputedSize([nsFont pointSize] * zoomFactor); |
| 563 result.setSpecifiedSize([nsFont pointSize] * zoomFactor); | 551 result.setSpecifiedSize([nsFont pointSize] * zoomFactor); |
| 564 return result; | 552 return result; |
| 565 } | 553 } |
| 566 default: | 554 default: |
| 567 return Theme::controlFont(part, fontDescription, zoomFactor); | 555 return Theme::controlFont(part, fontDescription, zoomFactor); |
| 568 } | 556 } |
| 569 } | 557 } |
| 570 | 558 |
| 571 LengthSize ThemeMac::controlSize(ControlPart part, const FontDescription& fontDe
scription, const LengthSize& zoomedSize, float zoomFactor) const | 559 LengthSize ThemeMac::controlSize(ControlPart part, const FontDescription& fontDe
scription, const LengthSize& zoomedSize, float zoomFactor) const |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 // focus ring with the frame. | 710 // focus ring with the frame. |
| 723 return floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_7; | 711 return floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_7; |
| 724 #else | 712 #else |
| 725 // If compiling an OSX 10.7 or older SDK, OSes up through 10.9 will draw a focus | 713 // If compiling an OSX 10.7 or older SDK, OSes up through 10.9 will draw a focus |
| 726 // ring with the frame. | 714 // ring with the frame. |
| 727 return floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_9; | 715 return floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_9; |
| 728 #endif | 716 #endif |
| 729 } | 717 } |
| 730 | 718 |
| 731 } | 719 } |
| OLD | NEW |