| OLD | NEW |
| 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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 return true; | 522 return true; |
| 523 // FIXME: NSSearchFieldCell doesn't work well when scaled. | 523 // FIXME: NSSearchFieldCell doesn't work well when scaled. |
| 524 if (style->appearance() == SearchFieldPart && style->effectiveZoom() != 1) | 524 if (style->appearance() == SearchFieldPart && style->effectiveZoom() != 1) |
| 525 return true; | 525 return true; |
| 526 | 526 |
| 527 return RenderTheme::isControlStyled(style, uaStyle); | 527 return RenderTheme::isControlStyled(style, uaStyle); |
| 528 } | 528 } |
| 529 | 529 |
| 530 const int sliderThumbShadowBlur = 1; | 530 const int sliderThumbShadowBlur = 1; |
| 531 | 531 |
| 532 void RenderThemeChromiumMac::adjustRepaintRect(const RenderObject* o, IntRect& r
) | 532 void RenderThemeChromiumMac::adjustPaintInvalidationRect(const RenderObject* o,
IntRect& r) |
| 533 { | 533 { |
| 534 ControlPart part = o->style()->appearance(); | 534 ControlPart part = o->style()->appearance(); |
| 535 | 535 |
| 536 #if USE(NEW_THEME) | 536 #if USE(NEW_THEME) |
| 537 switch (part) { | 537 switch (part) { |
| 538 case CheckboxPart: | 538 case CheckboxPart: |
| 539 case RadioPart: | 539 case RadioPart: |
| 540 case PushButtonPart: | 540 case PushButtonPart: |
| 541 case SquareButtonPart: | 541 case SquareButtonPart: |
| 542 case ButtonPart: | 542 case ButtonPart: |
| 543 case InnerSpinButtonPart: | 543 case InnerSpinButtonPart: |
| 544 return RenderTheme::adjustRepaintRect(o, r); | 544 return RenderTheme::adjustPaintInvalidationRect(o, r); |
| 545 default: | 545 default: |
| 546 break; | 546 break; |
| 547 } | 547 } |
| 548 #endif | 548 #endif |
| 549 | 549 |
| 550 float zoomLevel = o->style()->effectiveZoom(); | 550 float zoomLevel = o->style()->effectiveZoom(); |
| 551 | 551 |
| 552 if (part == MenulistPart) { | 552 if (part == MenulistPart) { |
| 553 setPopupButtonCellState(o, r); | 553 setPopupButtonCellState(o, r); |
| 554 IntSize size = popupButtonSizes()[[popupButton() controlSize]]; | 554 IntSize size = popupButtonSizes()[[popupButton() controlSize]]; |
| (...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1780 NSView* RenderThemeChromiumMac::documentViewFor(RenderObject*) const | 1780 NSView* RenderThemeChromiumMac::documentViewFor(RenderObject*) const |
| 1781 { | 1781 { |
| 1782 return FlippedView(); | 1782 return FlippedView(); |
| 1783 } | 1783 } |
| 1784 | 1784 |
| 1785 // Updates the control tint (a.k.a. active state) of |cell| (from |o|). | 1785 // Updates the control tint (a.k.a. active state) of |cell| (from |o|). |
| 1786 // In the Chromium port, the renderer runs as a background process and controls' | 1786 // In the Chromium port, the renderer runs as a background process and controls' |
| 1787 // NSCell(s) lack a parent NSView. Therefore controls don't have their tint | 1787 // NSCell(s) lack a parent NSView. Therefore controls don't have their tint |
| 1788 // color updated correctly when the application is activated/deactivated. | 1788 // color updated correctly when the application is activated/deactivated. |
| 1789 // FocusController's setActive() is called when the application is | 1789 // FocusController's setActive() is called when the application is |
| 1790 // activated/deactivated, which causes a repaint at which time this code is | 1790 // activated/deactivated, which causes a paint invalidation at which time this c
ode is |
| 1791 // called. | 1791 // called. |
| 1792 // This function should be called before drawing any NSCell-derived controls, | 1792 // This function should be called before drawing any NSCell-derived controls, |
| 1793 // unless you're sure it isn't needed. | 1793 // unless you're sure it isn't needed. |
| 1794 void RenderThemeChromiumMac::updateActiveState(NSCell* cell, const RenderObject*
o) | 1794 void RenderThemeChromiumMac::updateActiveState(NSCell* cell, const RenderObject*
o) |
| 1795 { | 1795 { |
| 1796 NSControlTint oldTint = [cell controlTint]; | 1796 NSControlTint oldTint = [cell controlTint]; |
| 1797 NSControlTint tint = isActive(o) ? [NSColor currentControlTint] : | 1797 NSControlTint tint = isActive(o) ? [NSColor currentControlTint] : |
| 1798 static_cast<NSControlTint>(NSClearControl
Tint); | 1798 static_cast<NSControlTint>(NSClearControl
Tint); |
| 1799 | 1799 |
| 1800 if (tint != oldTint) | 1800 if (tint != oldTint) |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1887 | 1887 |
| 1888 bool RenderThemeChromiumMac::shouldUseFallbackTheme(RenderStyle* style) const | 1888 bool RenderThemeChromiumMac::shouldUseFallbackTheme(RenderStyle* style) const |
| 1889 { | 1889 { |
| 1890 ControlPart part = style->appearance(); | 1890 ControlPart part = style->appearance(); |
| 1891 if (part == CheckboxPart || part == RadioPart) | 1891 if (part == CheckboxPart || part == RadioPart) |
| 1892 return style->effectiveZoom() != 1; | 1892 return style->effectiveZoom() != 1; |
| 1893 return false; | 1893 return false; |
| 1894 } | 1894 } |
| 1895 | 1895 |
| 1896 } // namespace blink | 1896 } // namespace blink |
| OLD | NEW |