Chromium Code Reviews| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 137 - (BOOL)isFlipped { | 137 - (BOOL)isFlipped { |
| 138 return [[NSGraphicsContext currentContext] isFlipped]; | 138 return [[NSGraphicsContext currentContext] isFlipped]; |
| 139 } | 139 } |
| 140 | 140 |
| 141 - (NSText *)currentEditor { | 141 - (NSText *)currentEditor { |
| 142 return nil; | 142 return nil; |
| 143 } | 143 } |
| 144 | 144 |
| 145 @end | 145 @end |
| 146 | 146 |
| 147 // Forward declare Mac SPIs. | |
| 148 extern "C" { | |
| 149 void _NSDrawCarbonThemeBezel(NSRect frame, BOOL enabled, BOOL flipped); | |
| 150 void _NSDrawCarbonThemeListBox(NSRect frame, BOOL enabled, BOOL flipped, BOOL al ways_yes); | |
| 151 } | |
| 152 | |
| 147 namespace WebCore { | 153 namespace WebCore { |
| 148 | 154 |
| 149 using namespace HTMLNames; | 155 using namespace HTMLNames; |
| 150 | 156 |
| 151 enum { | 157 enum { |
| 152 topMargin, | 158 topMargin, |
| 153 rightMargin, | 159 rightMargin, |
| 154 bottomMargin, | 160 bottomMargin, |
| 155 leftMargin | 161 leftMargin |
| 156 }; | 162 }; |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 729 LocalCurrentGraphicsContext localContext(paintInfo.context); | 735 LocalCurrentGraphicsContext localContext(paintInfo.context); |
| 730 | 736 |
| 731 #if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1070 | 737 #if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1070 |
| 732 bool useNSTextFieldCell = o->style()->hasAppearance() | 738 bool useNSTextFieldCell = o->style()->hasAppearance() |
| 733 && o->style()->visitedDependentColor(CSSPropertyBackgroundColor) == Colo r::white | 739 && o->style()->visitedDependentColor(CSSPropertyBackgroundColor) == Colo r::white |
| 734 && !o->style()->hasBackgroundImage(); | 740 && !o->style()->hasBackgroundImage(); |
| 735 | 741 |
| 736 // We do not use NSTextFieldCell to draw styled text fields on Lion and Snow Leopard because | 742 // We do not use NSTextFieldCell to draw styled text fields on Lion and Snow Leopard because |
| 737 // there are a number of bugs on those platforms that require NSTextFieldCel l to be in charge | 743 // there are a number of bugs on those platforms that require NSTextFieldCel l to be in charge |
| 738 // of painting its own background. We need WebCore to paint styled backgroun ds, so we'll use | 744 // of painting its own background. We need WebCore to paint styled backgroun ds, so we'll use |
| 739 // this WebCoreSystemInterface function instead. | 745 // this AppKit SPI function instead. |
| 740 if (!useNSTextFieldCell) { | 746 if (!useNSTextFieldCell) { |
| 741 WKDrawBezeledTextFieldCell(r, isEnabled(o) && !isReadOnlyControl(o)); | 747 _NSDrawCarbonThemeBezel(r, isEnabled(o) && !isReadOnlyControl(o), YES); |
|
Nico
2013/05/01 01:02:18
This is ok since this seems to be unnecessary on 1
Robert Sesek
2013/05/01 23:58:43
Correct.
| |
| 742 return false; | 748 return false; |
| 743 } | 749 } |
| 744 #endif | 750 #endif |
| 745 | 751 |
| 746 NSTextFieldCell *textField = this->textField(); | 752 NSTextFieldCell *textField = this->textField(); |
| 747 | 753 |
| 748 GraphicsContextStateSaver stateSaver(*paintInfo.context); | 754 GraphicsContextStateSaver stateSaver(*paintInfo.context); |
| 749 | 755 |
| 750 [textField setEnabled:(isEnabled(o) && !isReadOnlyControl(o))]; | 756 [textField setEnabled:(isEnabled(o) && !isReadOnlyControl(o))]; |
| 751 [textField drawWithFrame:NSRect(r) inView:documentViewFor(o)]; | 757 [textField drawWithFrame:NSRect(r) inView:documentViewFor(o)]; |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 766 | 772 |
| 767 LocalCurrentGraphicsContext localContext(paintInfo.context); | 773 LocalCurrentGraphicsContext localContext(paintInfo.context); |
| 768 WKDrawCapsLockIndicator(localContext.cgContext(), r); | 774 WKDrawCapsLockIndicator(localContext.cgContext(), r); |
| 769 | 775 |
| 770 return false; | 776 return false; |
| 771 } | 777 } |
| 772 | 778 |
| 773 bool RenderThemeChromiumMac::paintTextArea(RenderObject* o, const PaintInfo& pai ntInfo, const IntRect& r) | 779 bool RenderThemeChromiumMac::paintTextArea(RenderObject* o, const PaintInfo& pai ntInfo, const IntRect& r) |
| 774 { | 780 { |
| 775 LocalCurrentGraphicsContext localContext(paintInfo.context); | 781 LocalCurrentGraphicsContext localContext(paintInfo.context); |
| 776 WKDrawBezeledTextArea(r, isEnabled(o) && !isReadOnlyControl(o)); | 782 _NSDrawCarbonThemeListBox(r, isEnabled(o) && !isReadOnlyControl(o), YES, YES ); |
|
Robert Sesek
2013/05/01 23:58:43
Filed.
| |
| 777 return false; | 783 return false; |
| 778 } | 784 } |
| 779 | 785 |
| 780 void RenderThemeChromiumMac::adjustTextAreaStyle(StyleResolver*, RenderStyle*, E lement*) const | 786 void RenderThemeChromiumMac::adjustTextAreaStyle(StyleResolver*, RenderStyle*, E lement*) const |
| 781 { | 787 { |
| 782 } | 788 } |
| 783 | 789 |
| 784 const int* RenderThemeChromiumMac::popupButtonMargins() const | 790 const int* RenderThemeChromiumMac::popupButtonMargins() const |
| 785 { | 791 { |
| 786 static const int margins[3][4] = | 792 static const int margins[3][4] = |
| (...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1969 { | 1975 { |
| 1970 return RenderMediaControlsChromium::paintMediaControlsPart(MediaEnterFullscr eenButton, object, paintInfo, rect); | 1976 return RenderMediaControlsChromium::paintMediaControlsPart(MediaEnterFullscr eenButton, object, paintInfo, rect); |
| 1971 } | 1977 } |
| 1972 | 1978 |
| 1973 bool RenderThemeChromiumMac::paintMediaToggleClosedCaptionsButton(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect) | 1979 bool RenderThemeChromiumMac::paintMediaToggleClosedCaptionsButton(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect) |
| 1974 { | 1980 { |
| 1975 return RenderMediaControlsChromium::paintMediaControlsPart(MediaShowClosedCa ptionsButton, object, paintInfo, rect); | 1981 return RenderMediaControlsChromium::paintMediaControlsPart(MediaShowClosedCa ptionsButton, object, paintInfo, rect); |
| 1976 } | 1982 } |
| 1977 | 1983 |
| 1978 } // namespace WebCore | 1984 } // namespace WebCore |
| OLD | NEW |