Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutThemeMac.mm

Issue 2614883007: Change computed style enums to be prefixed with 'k'. (Closed)
Patch Set: Rebase on ToT. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Google, Inc. 3 * Copyright (C) 2008, 2009 Google, Inc.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 return true; 478 return true;
479 if (!fontSizeMatchesToControlSize(style)) 479 if (!fontSizeMatchesToControlSize(style))
480 return true; 480 return true;
481 if (style.getFontDescription().family().family() != 481 if (style.getFontDescription().family().family() !=
482 FontFamilyNames::system_ui) 482 FontFamilyNames::system_ui)
483 return true; 483 return true;
484 if (!style.height().isIntrinsicOrAuto()) 484 if (!style.height().isIntrinsicOrAuto())
485 return true; 485 return true;
486 // NSPopUpButtonCell on macOS 10.9 doesn't support 486 // NSPopUpButtonCell on macOS 10.9 doesn't support
487 // NSUserInterfaceLayoutDirectionRightToLeft. 487 // NSUserInterfaceLayoutDirectionRightToLeft.
488 if (IsOS10_9() && style.direction() == TextDirection::Rtl) 488 if (IsOS10_9() && style.direction() == TextDirection::kRtl)
489 return true; 489 return true;
490 } 490 }
491 // Some other cells don't work well when scaled. 491 // Some other cells don't work well when scaled.
492 if (style.effectiveZoom() != 1) { 492 if (style.effectiveZoom() != 1) {
493 switch (style.appearance()) { 493 switch (style.appearance()) {
494 case ButtonPart: 494 case ButtonPart:
495 case PushButtonPart: 495 case PushButtonPart:
496 case SearchFieldPart: 496 case SearchFieldPart:
497 case SquareButtonPart: 497 case SquareButtonPart:
498 return true; 498 return true;
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 Element* e) const { 711 Element* e) const {
712 NSControlSize controlSize = controlSizeForFont(style); 712 NSControlSize controlSize = controlSizeForFont(style);
713 713
714 style.resetBorder(); 714 style.resetBorder();
715 style.resetPadding(); 715 style.resetPadding();
716 716
717 // Height is locked to auto. 717 // Height is locked to auto.
718 style.setHeight(Length(Auto)); 718 style.setHeight(Length(Auto));
719 719
720 // White-space is locked to pre. 720 // White-space is locked to pre.
721 style.setWhiteSpace(EWhiteSpace::Pre); 721 style.setWhiteSpace(EWhiteSpace::kPre);
722 722
723 // Set the foreground color to black or gray when we have the aqua look. 723 // Set the foreground color to black or gray when we have the aqua look.
724 // Cast to RGB32 is to work around a compiler bug. 724 // Cast to RGB32 is to work around a compiler bug.
725 style.setColor(e && !e->isDisabledFormControl() 725 style.setColor(e && !e->isDisabledFormControl()
726 ? static_cast<RGBA32>(Color::black) 726 ? static_cast<RGBA32>(Color::black)
727 : Color::darkGray); 727 : Color::darkGray);
728 728
729 // Set the button's vertical size. 729 // Set the button's vertical size.
730 setSizeFromFont(style, menuListButtonSizes()); 730 setSizeFromFont(style, menuListButtonSizes());
731 731
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 setControlSize(popupButton, popupButtonSizes(), rect.size(), 813 setControlSize(popupButton, popupButtonSizes(), rect.size(),
814 object.styleRef().effectiveZoom()); 814 object.styleRef().effectiveZoom());
815 815
816 // Update the various states we respond to. 816 // Update the various states we respond to.
817 updateActiveState(popupButton, object); 817 updateActiveState(popupButton, object);
818 updateCheckedState(popupButton, object); 818 updateCheckedState(popupButton, object);
819 updateEnabledState(popupButton, object); 819 updateEnabledState(popupButton, object);
820 updatePressedState(popupButton, object); 820 updatePressedState(popupButton, object);
821 821
822 popupButton.userInterfaceLayoutDirection = 822 popupButton.userInterfaceLayoutDirection =
823 object.styleRef().direction() == TextDirection::Ltr 823 object.styleRef().direction() == TextDirection::kLtr
824 ? NSUserInterfaceLayoutDirectionLeftToRight 824 ? NSUserInterfaceLayoutDirectionLeftToRight
825 : NSUserInterfaceLayoutDirectionRightToLeft; 825 : NSUserInterfaceLayoutDirectionRightToLeft;
826 } 826 }
827 827
828 const IntSize* LayoutThemeMac::menuListSizes() const { 828 const IntSize* LayoutThemeMac::menuListSizes() const {
829 static const IntSize sizes[3] = {IntSize(9, 0), IntSize(5, 0), IntSize(0, 0)}; 829 static const IntSize sizes[3] = {IntSize(9, 0), IntSize(5, 0), IntSize(0, 0)};
830 return sizes; 830 return sizes;
831 } 831 }
832 832
833 int LayoutThemeMac::minimumMenuListSize(const ComputedStyle& style) const { 833 int LayoutThemeMac::minimumMenuListSize(const ComputedStyle& style) const {
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 } 1103 }
1104 1104
1105 bool LayoutThemeMac::shouldUseFallbackTheme(const ComputedStyle& style) const { 1105 bool LayoutThemeMac::shouldUseFallbackTheme(const ComputedStyle& style) const {
1106 ControlPart part = style.appearance(); 1106 ControlPart part = style.appearance();
1107 if (part == CheckboxPart || part == RadioPart) 1107 if (part == CheckboxPart || part == RadioPart)
1108 return style.effectiveZoom() != 1; 1108 return style.effectiveZoom() != 1;
1109 return false; 1109 return false;
1110 } 1110 }
1111 1111
1112 } // namespace blink 1112 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTheme.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698