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

Side by Side Diff: Source/core/rendering/RenderThemeChromiumMac.mm

Issue 14574002: Replace some trivial WebKitSystemInterface wrappers with direct calls to SPI. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Radar links Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/platform/mac/WebCoreSystemInterface.h ('k') | no next file » | 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Request for public API: rdar://13787640
151 void _NSDrawCarbonThemeListBox(NSRect frame, BOOL enabled, BOOL flipped, BOOL al ways_yes);
152 }
153
147 namespace WebCore { 154 namespace WebCore {
148 155
149 using namespace HTMLNames; 156 using namespace HTMLNames;
150 157
151 enum { 158 enum {
152 topMargin, 159 topMargin,
153 rightMargin, 160 rightMargin,
154 bottomMargin, 161 bottomMargin,
155 leftMargin 162 leftMargin
156 }; 163 };
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 LocalCurrentGraphicsContext localContext(paintInfo.context); 736 LocalCurrentGraphicsContext localContext(paintInfo.context);
730 737
731 #if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1070 738 #if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1070
732 bool useNSTextFieldCell = o->style()->hasAppearance() 739 bool useNSTextFieldCell = o->style()->hasAppearance()
733 && o->style()->visitedDependentColor(CSSPropertyBackgroundColor) == Colo r::white 740 && o->style()->visitedDependentColor(CSSPropertyBackgroundColor) == Colo r::white
734 && !o->style()->hasBackgroundImage(); 741 && !o->style()->hasBackgroundImage();
735 742
736 // We do not use NSTextFieldCell to draw styled text fields on Lion and Snow Leopard because 743 // 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 744 // 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 745 // of painting its own background. We need WebCore to paint styled backgroun ds, so we'll use
739 // this WebCoreSystemInterface function instead. 746 // this AppKit SPI function instead.
740 if (!useNSTextFieldCell) { 747 if (!useNSTextFieldCell) {
741 WKDrawBezeledTextFieldCell(r, isEnabled(o) && !isReadOnlyControl(o)); 748 _NSDrawCarbonThemeBezel(r, isEnabled(o) && !isReadOnlyControl(o), YES);
742 return false; 749 return false;
743 } 750 }
744 #endif 751 #endif
745 752
746 NSTextFieldCell *textField = this->textField(); 753 NSTextFieldCell *textField = this->textField();
747 754
748 GraphicsContextStateSaver stateSaver(*paintInfo.context); 755 GraphicsContextStateSaver stateSaver(*paintInfo.context);
749 756
750 [textField setEnabled:(isEnabled(o) && !isReadOnlyControl(o))]; 757 [textField setEnabled:(isEnabled(o) && !isReadOnlyControl(o))];
751 [textField drawWithFrame:NSRect(r) inView:documentViewFor(o)]; 758 [textField drawWithFrame:NSRect(r) inView:documentViewFor(o)];
(...skipping 14 matching lines...) Expand all
766 773
767 LocalCurrentGraphicsContext localContext(paintInfo.context); 774 LocalCurrentGraphicsContext localContext(paintInfo.context);
768 WKDrawCapsLockIndicator(localContext.cgContext(), r); 775 WKDrawCapsLockIndicator(localContext.cgContext(), r);
769 776
770 return false; 777 return false;
771 } 778 }
772 779
773 bool RenderThemeChromiumMac::paintTextArea(RenderObject* o, const PaintInfo& pai ntInfo, const IntRect& r) 780 bool RenderThemeChromiumMac::paintTextArea(RenderObject* o, const PaintInfo& pai ntInfo, const IntRect& r)
774 { 781 {
775 LocalCurrentGraphicsContext localContext(paintInfo.context); 782 LocalCurrentGraphicsContext localContext(paintInfo.context);
776 WKDrawBezeledTextArea(r, isEnabled(o) && !isReadOnlyControl(o)); 783 _NSDrawCarbonThemeListBox(r, isEnabled(o) && !isReadOnlyControl(o), YES, YES );
777 return false; 784 return false;
778 } 785 }
779 786
780 void RenderThemeChromiumMac::adjustTextAreaStyle(StyleResolver*, RenderStyle*, E lement*) const 787 void RenderThemeChromiumMac::adjustTextAreaStyle(StyleResolver*, RenderStyle*, E lement*) const
781 { 788 {
782 } 789 }
783 790
784 const int* RenderThemeChromiumMac::popupButtonMargins() const 791 const int* RenderThemeChromiumMac::popupButtonMargins() const
785 { 792 {
786 static const int margins[3][4] = 793 static const int margins[3][4] =
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1969 { 1976 {
1970 return RenderMediaControlsChromium::paintMediaControlsPart(MediaEnterFullscr eenButton, object, paintInfo, rect); 1977 return RenderMediaControlsChromium::paintMediaControlsPart(MediaEnterFullscr eenButton, object, paintInfo, rect);
1971 } 1978 }
1972 1979
1973 bool RenderThemeChromiumMac::paintMediaToggleClosedCaptionsButton(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect) 1980 bool RenderThemeChromiumMac::paintMediaToggleClosedCaptionsButton(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
1974 { 1981 {
1975 return RenderMediaControlsChromium::paintMediaControlsPart(MediaShowClosedCa ptionsButton, object, paintInfo, rect); 1982 return RenderMediaControlsChromium::paintMediaControlsPart(MediaShowClosedCa ptionsButton, object, paintInfo, rect);
1976 } 1983 }
1977 1984
1978 } // namespace WebCore 1985 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/platform/mac/WebCoreSystemInterface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698