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

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

Issue 1186523004: Rename adjustPaintInvalidationRect and related to addVisualOverflow (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « Source/core/layout/LayoutThemeMac.h ('k') | Source/modules/accessibility/AXObject.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 // like the control is styled. 451 // like the control is styled.
452 if (style.appearance() == MenulistPart && style.effectiveZoom() != 1.0f) 452 if (style.appearance() == MenulistPart && style.effectiveZoom() != 1.0f)
453 return true; 453 return true;
454 // FIXME: NSSearchFieldCell doesn't work well when scaled. 454 // FIXME: NSSearchFieldCell doesn't work well when scaled.
455 if (style.appearance() == SearchFieldPart && style.effectiveZoom() != 1) 455 if (style.appearance() == SearchFieldPart && style.effectiveZoom() != 1)
456 return true; 456 return true;
457 457
458 return LayoutTheme::isControlStyled(style, authorStyle); 458 return LayoutTheme::isControlStyled(style, authorStyle);
459 } 459 }
460 460
461 void LayoutThemeMac::adjustPaintInvalidationRect(const LayoutObject* o, IntRect& r) 461 void LayoutThemeMac::addVisualOverflow(const LayoutObject& object, IntRect& rect )
462 { 462 {
463 ControlPart part = o->style()->appearance(); 463 ControlPart part = object.style()->appearance();
464 464
465 #if USE(NEW_THEME) 465 #if USE(NEW_THEME)
466 switch (part) { 466 switch (part) {
467 case CheckboxPart: 467 case CheckboxPart:
468 case RadioPart: 468 case RadioPart:
469 case PushButtonPart: 469 case PushButtonPart:
470 case SquareButtonPart: 470 case SquareButtonPart:
471 case ButtonPart: 471 case ButtonPart:
472 case InnerSpinButtonPart: 472 case InnerSpinButtonPart:
473 return LayoutTheme::adjustPaintInvalidationRect(o, r); 473 return LayoutTheme::addVisualOverflow(object, rect);
474 default: 474 default:
475 break; 475 break;
476 } 476 }
477 #endif 477 #endif
478 478
479 float zoomLevel = o->style()->effectiveZoom(); 479 float zoomLevel = object.style()->effectiveZoom();
480 480
481 if (part == MenulistPart) { 481 if (part == MenulistPart) {
482 setPopupButtonCellState(o, r); 482 setPopupButtonCellState(&object, rect);
483 IntSize size = popupButtonSizes()[[popupButton() controlSize]]; 483 IntSize size = popupButtonSizes()[[popupButton() controlSize]];
484 size.setHeight(size.height() * zoomLevel); 484 size.setHeight(size.height() * zoomLevel);
485 size.setWidth(r.width()); 485 size.setWidth(rect.width());
486 r = ThemeMac::inflateRect(r, size, popupButtonMargins(), zoomLevel); 486 rect = ThemeMac::inflateRect(rect, size, popupButtonMargins(), zoomLevel );
487 } else if (part == SliderThumbHorizontalPart || part == SliderThumbVerticalP art) { 487 } else if (part == SliderThumbHorizontalPart || part == SliderThumbVerticalP art) {
488 r.setHeight(r.height() + sliderThumbShadowBlur); 488 rect.setHeight(rect.height() + sliderThumbShadowBlur);
489 } 489 }
490 } 490 }
491 491
492 void LayoutThemeMac::updateCheckedState(NSCell* cell, const LayoutObject* o) 492 void LayoutThemeMac::updateCheckedState(NSCell* cell, const LayoutObject* o)
493 { 493 {
494 bool oldIndeterminate = [cell state] == NSMixedState; 494 bool oldIndeterminate = [cell state] == NSMixedState;
495 bool indeterminate = isIndeterminate(o); 495 bool indeterminate = isIndeterminate(o);
496 bool checked = isChecked(o); 496 bool checked = isChecked(o);
497 497
498 if (oldIndeterminate != indeterminate) { 498 if (oldIndeterminate != indeterminate) {
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 861
862 style.resetPadding(); 862 style.resetPadding();
863 style.setBorderRadius(IntSize(int(baseBorderRadius + fontScale - 1), int(bas eBorderRadius + fontScale - 1))); // FIXME: Round up? 863 style.setBorderRadius(IntSize(int(baseBorderRadius + fontScale - 1), int(bas eBorderRadius + fontScale - 1))); // FIXME: Round up?
864 864
865 const int minHeight = 15; 865 const int minHeight = 15;
866 style.setMinHeight(Length(minHeight, Fixed)); 866 style.setMinHeight(Length(minHeight, Fixed));
867 867
868 style.setLineHeight(ComputedStyle::initialLineHeight()); 868 style.setLineHeight(ComputedStyle::initialLineHeight());
869 } 869 }
870 870
871 void LayoutThemeMac::setPopupButtonCellState(const LayoutObject* o, const IntRec t& r) 871 void LayoutThemeMac::setPopupButtonCellState(const LayoutObject* object, const I ntRect& rect)
872 { 872 {
873 NSPopUpButtonCell* popupButton = this->popupButton(); 873 NSPopUpButtonCell* popupButton = this->popupButton();
874 874
875 // Set the control size based off the rectangle we're painting into. 875 // Set the control size based off the rectangle we're painting into.
876 setControlSize(popupButton, popupButtonSizes(), r.size(), o->style()->effect iveZoom()); 876 setControlSize(popupButton, popupButtonSizes(), rect.size(), object->style() ->effectiveZoom());
877 877
878 // Update the various states we respond to. 878 // Update the various states we respond to.
879 updateActiveState(popupButton, o); 879 updateActiveState(popupButton, object);
880 updateCheckedState(popupButton, o); 880 updateCheckedState(popupButton, object);
881 updateEnabledState(popupButton, o); 881 updateEnabledState(popupButton, object);
882 updatePressedState(popupButton, o); 882 updatePressedState(popupButton, object);
883 if (![popupButton respondsToSelector:@selector(drawFocusRingMaskWithFrame:in View:)]) 883 if (![popupButton respondsToSelector:@selector(drawFocusRingMaskWithFrame:in View:)])
884 updateFocusedState(popupButton, o); 884 updateFocusedState(popupButton, object);
885 } 885 }
886 886
887 const IntSize* LayoutThemeMac::menuListSizes() const 887 const IntSize* LayoutThemeMac::menuListSizes() const
888 { 888 {
889 static const IntSize sizes[3] = { IntSize(9, 0), IntSize(5, 0), IntSize(0, 0 ) }; 889 static const IntSize sizes[3] = { IntSize(9, 0), IntSize(5, 0), IntSize(0, 0 ) };
890 return sizes; 890 return sizes;
891 } 891 }
892 892
893 int LayoutThemeMac::minimumMenuListSize(const ComputedStyle& style) const 893 int LayoutThemeMac::minimumMenuListSize(const ComputedStyle& style) const
894 { 894 {
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 1169
1170 bool LayoutThemeMac::shouldUseFallbackTheme(const ComputedStyle& style) const 1170 bool LayoutThemeMac::shouldUseFallbackTheme(const ComputedStyle& style) const
1171 { 1171 {
1172 ControlPart part = style.appearance(); 1172 ControlPart part = style.appearance();
1173 if (part == CheckboxPart || part == RadioPart) 1173 if (part == CheckboxPart || part == RadioPart)
1174 return style.effectiveZoom() != 1; 1174 return style.effectiveZoom() != 1;
1175 return false; 1175 return false;
1176 } 1176 }
1177 1177
1178 } // namespace blink 1178 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutThemeMac.h ('k') | Source/modules/accessibility/AXObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698