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

Unified Diff: Source/core/layout/LayoutThemeChromiumMac.mm

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix a crashers (everything is building!) Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/layout/LayoutThemeChromiumMac.mm
diff --git a/Source/core/layout/LayoutThemeChromiumMac.mm b/Source/core/layout/LayoutThemeChromiumMac.mm
index 66c6dc4b023da4b58883efbad0695b764c872214..324766534ce05f8bc770bd7b1dba41ce54f55190 100644
--- a/Source/core/layout/LayoutThemeChromiumMac.mm
+++ b/Source/core/layout/LayoutThemeChromiumMac.mm
@@ -585,7 +585,7 @@ void LayoutThemeChromiumMac::updatePressedState(NSCell* cell, const RenderObject
[cell setHighlighted:pressed];
}
-NSControlSize LayoutThemeChromiumMac::controlSizeForFont(RenderStyle* style) const
+NSControlSize LayoutThemeChromiumMac::controlSizeForFont(const RenderStyle* style) const
{
int fontSize = style->fontSize();
if (fontSize >= 16)
@@ -598,7 +598,7 @@ NSControlSize LayoutThemeChromiumMac::controlSizeForFont(RenderStyle* style) con
// We don't use controlSizeForFont() for search field decorations because it
// needs to fit into the search field. The font size will already be modified by
// setFontFromControlSize() called on the search field.
-static NSControlSize searchFieldControlSizeForFont(RenderStyle* style)
+static NSControlSize searchFieldControlSizeForFont(const RenderStyle* style)
{
int fontSize = style->fontSize();
if (fontSize >= 13)
@@ -625,7 +625,7 @@ void LayoutThemeChromiumMac::setControlSize(NSCell* cell, const IntSize* sizes,
[cell setControlSize:size];
}
-IntSize LayoutThemeChromiumMac::sizeForFont(RenderStyle* style, const IntSize* sizes) const
+IntSize LayoutThemeChromiumMac::sizeForFont(const RenderStyle* style, const IntSize* sizes) const
{
if (style->effectiveZoom() != 1.0f) {
IntSize result = sizes[controlSizeForFont(style)];
@@ -634,7 +634,7 @@ IntSize LayoutThemeChromiumMac::sizeForFont(RenderStyle* style, const IntSize* s
return sizes[controlSizeForFont(style)];
}
-IntSize LayoutThemeChromiumMac::sizeForSystemFont(RenderStyle* style, const IntSize* sizes) const
+IntSize LayoutThemeChromiumMac::sizeForSystemFont(const RenderStyle* style, const IntSize* sizes) const
{
if (style->effectiveZoom() != 1.0f) {
IntSize result = sizes[controlSizeForSystemFont(style)];
@@ -672,7 +672,7 @@ void LayoutThemeChromiumMac::setFontFromControlSize(RenderStyle* style, NSContro
style->font().update(nullptr);
}
-NSControlSize LayoutThemeChromiumMac::controlSizeForSystemFont(RenderStyle* style) const
+NSControlSize LayoutThemeChromiumMac::controlSizeForSystemFont(const RenderStyle* style) const
{
float fontSize = style->fontSize();
float zoomLevel = style->effectiveZoom();
@@ -914,7 +914,7 @@ NSLevelIndicatorStyle LayoutThemeChromiumMac::levelIndicatorStyleFor(ControlPart
NSLevelIndicatorCell* LayoutThemeChromiumMac::levelIndicatorFor(const RenderMeter* renderMeter) const
{
- RenderStyle* style = renderMeter->style();
+ const RenderStyle* style = renderMeter->style();
ASSERT(style->appearance() != NoControlPart);
if (!m_levelIndicator)
@@ -972,7 +972,7 @@ const int* LayoutThemeChromiumMac::progressBarMargins(NSControlSize controlSize)
return margins[controlSize];
}
-int LayoutThemeChromiumMac::minimumProgressBarHeight(RenderStyle* style) const
+int LayoutThemeChromiumMac::minimumProgressBarHeight(const RenderStyle* style) const
{
return sizeForSystemFont(style, progressBarSizes()).height();
}
@@ -1133,7 +1133,7 @@ const int autofillPopupHorizontalPadding = 4;
// TexfieldPart appearance here. We want to change only Autofill padding. In
// the future, we have to separate Autofill popup window logic from WebKit to
// Chromium.
-int LayoutThemeChromiumMac::popupInternalPaddingLeft(RenderStyle* style) const
+int LayoutThemeChromiumMac::popupInternalPaddingLeft(const RenderStyle* style) const
{
if (style->appearance() == TextFieldPart)
return autofillPopupHorizontalPadding;
@@ -1145,7 +1145,7 @@ int LayoutThemeChromiumMac::popupInternalPaddingLeft(RenderStyle* style) const
return 0;
}
-int LayoutThemeChromiumMac::popupInternalPaddingRight(RenderStyle* style) const
+int LayoutThemeChromiumMac::popupInternalPaddingRight(const RenderStyle* style) const
{
if (style->appearance() == TextFieldPart)
return autofillPopupHorizontalPadding;
@@ -1160,7 +1160,7 @@ int LayoutThemeChromiumMac::popupInternalPaddingRight(RenderStyle* style) const
return 0;
}
-int LayoutThemeChromiumMac::popupInternalPaddingTop(RenderStyle* style) const
+int LayoutThemeChromiumMac::popupInternalPaddingTop(const RenderStyle* style) const
{
if (style->appearance() == MenulistPart)
return popupButtonPadding(controlSizeForFont(style))[ThemeMac::TopMargin] * style->effectiveZoom();
@@ -1169,7 +1169,7 @@ int LayoutThemeChromiumMac::popupInternalPaddingTop(RenderStyle* style) const
return 0;
}
-int LayoutThemeChromiumMac::popupInternalPaddingBottom(RenderStyle* style) const
+int LayoutThemeChromiumMac::popupInternalPaddingBottom(const RenderStyle* style) const
{
if (style->appearance() == MenulistPart)
return popupButtonPadding(controlSizeForFont(style))[ThemeMac::BottomMargin] * style->effectiveZoom();
@@ -1214,7 +1214,7 @@ const IntSize* LayoutThemeChromiumMac::menuListSizes() const
return sizes;
}
-int LayoutThemeChromiumMac::minimumMenuListSize(RenderStyle* style) const
+int LayoutThemeChromiumMac::minimumMenuListSize(const RenderStyle* style) const
{
return sizeForSystemFont(style, menuListSizes()).width();
}
@@ -1842,7 +1842,7 @@ bool LayoutThemeChromiumMac::paintMediaToggleClosedCaptionsButton(RenderObject*
return RenderMediaControls::paintMediaControlsPart(MediaShowClosedCaptionsButton, object, paintInfo, rect);
}
-bool LayoutThemeChromiumMac::shouldUseFallbackTheme(RenderStyle* style) const
+bool LayoutThemeChromiumMac::shouldUseFallbackTheme(const RenderStyle* style) const
{
ControlPart part = style->appearance();
if (part == CheckboxPart || part == RadioPart)

Powered by Google App Engine
This is Rietveld 408576698