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

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

Issue 2555923002: Changed TextDirection to an enum class and renamed its members (Closed)
Patch Set: Rebase after reopen Created 4 years 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() == RTL) 488 if (IsOS10_9() && style.direction() == TextDirection::Rtl)
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 314 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() == LTR 823 object.styleRef().direction() == TextDirection::Ltr
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/LayoutTextTest.cpp ('k') | third_party/WebKit/Source/core/layout/TextAutosizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698