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

Unified Diff: Source/core/rendering/RenderThemeChromiumDefault.cpp

Issue 463123003: Cleanup namespace usage in Source/core/rendering (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 4 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/rendering/RenderThemeChromiumDefault.cpp
diff --git a/Source/core/rendering/RenderThemeChromiumDefault.cpp b/Source/core/rendering/RenderThemeChromiumDefault.cpp
index 69c2cdb8817945146afebea35861168f27bec40c..4c60c7e24355f2e9960226707124cc234e13194b 100644
--- a/Source/core/rendering/RenderThemeChromiumDefault.cpp
+++ b/Source/core/rendering/RenderThemeChromiumDefault.cpp
@@ -59,20 +59,20 @@ double RenderThemeChromiumDefault::m_caretBlinkInterval;
static const unsigned defaultButtonBackgroundColor = 0xffdddddd;
-static blink::WebThemeEngine::State getWebThemeState(const RenderTheme* theme, const RenderObject* o)
+static WebThemeEngine::State getWebThemeState(const RenderTheme* theme, const RenderObject* o)
{
if (!theme->isEnabled(o))
- return blink::WebThemeEngine::StateDisabled;
+ return WebThemeEngine::StateDisabled;
if (useMockTheme() && theme->isReadOnlyControl(o))
- return blink::WebThemeEngine::StateReadonly;
+ return WebThemeEngine::StateReadonly;
if (theme->isPressed(o))
- return blink::WebThemeEngine::StatePressed;
+ return WebThemeEngine::StatePressed;
if (useMockTheme() && theme->isFocused(o))
- return blink::WebThemeEngine::StateFocused;
+ return WebThemeEngine::StateFocused;
if (theme->isHovered(o))
- return blink::WebThemeEngine::StateHover;
+ return WebThemeEngine::StateHover;
- return blink::WebThemeEngine::StateNormal;
+ return WebThemeEngine::StateNormal;
}
PassRefPtr<RenderTheme> RenderThemeChromiumDefault::create()
@@ -206,7 +206,7 @@ int RenderThemeChromiumDefault::sliderTickOffsetFromTrackCenter() const
void RenderThemeChromiumDefault::adjustSliderThumbSize(RenderStyle* style, Element* element) const
{
- IntSize size = blink::Platform::current()->themeEngine()->getSize(blink::WebThemeEngine::PartSliderThumb);
+ IntSize size = Platform::current()->themeEngine()->getSize(WebThemeEngine::PartSliderThumb);
// FIXME: Mock theme doesn't handle zoomed sliders.
float zoomLevel = useMockTheme() ? 1 : style->effectiveZoom();
@@ -244,8 +244,8 @@ void RenderThemeChromiumDefault::setSelectionColors(
bool RenderThemeChromiumDefault::paintCheckbox(RenderObject* o, const PaintInfo& i, const IntRect& rect)
{
- blink::WebThemeEngine::ExtraParams extraParams;
- blink::WebCanvas* canvas = i.context->canvas();
+ WebThemeEngine::ExtraParams extraParams;
+ WebCanvas* canvas = i.context->canvas();
extraParams.button.checked = isChecked(o);
extraParams.button.indeterminate = isIndeterminate(o);
@@ -261,7 +261,7 @@ bool RenderThemeChromiumDefault::paintCheckbox(RenderObject* o, const PaintInfo&
i.context->translate(-unzoomedRect.x(), -unzoomedRect.y());
}
- blink::Platform::current()->themeEngine()->paint(canvas, blink::WebThemeEngine::PartCheckbox, getWebThemeState(this, o), blink::WebRect(unzoomedRect), &extraParams);
+ Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartCheckbox, getWebThemeState(this, o), WebRect(unzoomedRect), &extraParams);
return false;
}
@@ -271,7 +271,7 @@ void RenderThemeChromiumDefault::setCheckboxSize(RenderStyle* style) const
if (!style->width().isIntrinsicOrAuto() && !style->height().isAuto())
return;
- IntSize size = blink::Platform::current()->themeEngine()->getSize(blink::WebThemeEngine::PartCheckbox);
+ IntSize size = Platform::current()->themeEngine()->getSize(WebThemeEngine::PartCheckbox);
float zoomLevel = style->effectiveZoom();
size.setWidth(size.width() * zoomLevel);
size.setHeight(size.height() * zoomLevel);
@@ -280,11 +280,11 @@ void RenderThemeChromiumDefault::setCheckboxSize(RenderStyle* style) const
bool RenderThemeChromiumDefault::paintRadio(RenderObject* o, const PaintInfo& i, const IntRect& rect)
{
- blink::WebThemeEngine::ExtraParams extraParams;
- blink::WebCanvas* canvas = i.context->canvas();
+ WebThemeEngine::ExtraParams extraParams;
+ WebCanvas* canvas = i.context->canvas();
extraParams.button.checked = isChecked(o);
- blink::Platform::current()->themeEngine()->paint(canvas, blink::WebThemeEngine::PartRadio, getWebThemeState(this, o), blink::WebRect(rect), &extraParams);
+ Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartRadio, getWebThemeState(this, o), WebRect(rect), &extraParams);
return false;
}
@@ -294,7 +294,7 @@ void RenderThemeChromiumDefault::setRadioSize(RenderStyle* style) const
if (!style->width().isIntrinsicOrAuto() && !style->height().isAuto())
return;
- IntSize size = blink::Platform::current()->themeEngine()->getSize(blink::WebThemeEngine::PartRadio);
+ IntSize size = Platform::current()->themeEngine()->getSize(WebThemeEngine::PartRadio);
float zoomLevel = style->effectiveZoom();
size.setWidth(size.width() * zoomLevel);
size.setHeight(size.height() * zoomLevel);
@@ -303,14 +303,14 @@ void RenderThemeChromiumDefault::setRadioSize(RenderStyle* style) const
bool RenderThemeChromiumDefault::paintButton(RenderObject* o, const PaintInfo& i, const IntRect& rect)
{
- blink::WebThemeEngine::ExtraParams extraParams;
- blink::WebCanvas* canvas = i.context->canvas();
+ WebThemeEngine::ExtraParams extraParams;
+ WebCanvas* canvas = i.context->canvas();
extraParams.button.hasBorder = true;
extraParams.button.backgroundColor = useMockTheme() ? 0xffc0c0c0 : defaultButtonBackgroundColor;
if (o->hasBackground())
extraParams.button.backgroundColor = o->resolveColor(CSSPropertyBackgroundColor).rgb();
- blink::Platform::current()->themeEngine()->paint(canvas, blink::WebThemeEngine::PartButton, getWebThemeState(this, o), blink::WebRect(rect), &extraParams);
+ Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartButton, getWebThemeState(this, o), WebRect(rect), &extraParams);
return false;
}
@@ -323,16 +323,16 @@ bool RenderThemeChromiumDefault::paintTextField(RenderObject* o, const PaintInfo
ControlPart part = o->style()->appearance();
- blink::WebThemeEngine::ExtraParams extraParams;
+ WebThemeEngine::ExtraParams extraParams;
extraParams.textField.isTextArea = part == TextAreaPart;
extraParams.textField.isListbox = part == ListboxPart;
- blink::WebCanvas* canvas = i.context->canvas();
+ WebCanvas* canvas = i.context->canvas();
Color backgroundColor = o->resolveColor(CSSPropertyBackgroundColor);
extraParams.textField.backgroundColor = backgroundColor.rgb();
- blink::Platform::current()->themeEngine()->paint(canvas, blink::WebThemeEngine::PartTextField, getWebThemeState(this, o), blink::WebRect(rect), &extraParams);
+ Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartTextField, getWebThemeState(this, o), WebRect(rect), &extraParams);
return false;
}
@@ -344,7 +344,7 @@ bool RenderThemeChromiumDefault::paintMenuList(RenderObject* o, const PaintInfo&
const int right = rect.x() + rect.width();
const int middle = rect.y() + rect.height() / 2;
- blink::WebThemeEngine::ExtraParams extraParams;
+ WebThemeEngine::ExtraParams extraParams;
extraParams.menuList.arrowY = middle;
const RenderBox* box = toRenderBox(o);
// Match Chromium Win behaviour of showing all borders if any are shown.
@@ -375,9 +375,9 @@ bool RenderThemeChromiumDefault::paintMenuList(RenderObject* o, const PaintInfo&
extraParams.menuList.arrowX = (o->style()->direction() == RTL) ? rect.x() + 7 : right - 13;
}
- blink::WebCanvas* canvas = i.context->canvas();
+ WebCanvas* canvas = i.context->canvas();
- blink::Platform::current()->themeEngine()->paint(canvas, blink::WebThemeEngine::PartMenuList, getWebThemeState(this, o), blink::WebRect(rect), &extraParams);
+ Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartMenuList, getWebThemeState(this, o), WebRect(rect), &extraParams);
return false;
}
@@ -389,7 +389,7 @@ bool RenderThemeChromiumDefault::paintMenuListButton(RenderObject* o, const Pain
const int right = rect.x() + rect.width();
const int middle = rect.y() + rect.height() / 2;
- blink::WebThemeEngine::ExtraParams extraParams;
+ WebThemeEngine::ExtraParams extraParams;
extraParams.menuList.arrowY = middle;
extraParams.menuList.hasBorder = false;
extraParams.menuList.hasBorderRadius = o->style()->hasBorderRadius();
@@ -409,16 +409,16 @@ bool RenderThemeChromiumDefault::paintMenuListButton(RenderObject* o, const Pain
extraParams.menuList.arrowX = (o->style()->direction() == RTL) ? rect.x() + 7 : right - 13;
}
- blink::WebCanvas* canvas = i.context->canvas();
+ WebCanvas* canvas = i.context->canvas();
- blink::Platform::current()->themeEngine()->paint(canvas, blink::WebThemeEngine::PartMenuList, getWebThemeState(this, o), blink::WebRect(rect), &extraParams);
+ Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartMenuList, getWebThemeState(this, o), WebRect(rect), &extraParams);
return false;
}
bool RenderThemeChromiumDefault::paintSliderTrack(RenderObject* o, const PaintInfo& i, const IntRect& rect)
{
- blink::WebThemeEngine::ExtraParams extraParams;
- blink::WebCanvas* canvas = i.context->canvas();
+ WebThemeEngine::ExtraParams extraParams;
+ WebCanvas* canvas = i.context->canvas();
extraParams.slider.vertical = o->style()->appearance() == SliderVerticalPart;
paintSliderTicks(o, i, rect);
@@ -436,15 +436,15 @@ bool RenderThemeChromiumDefault::paintSliderTrack(RenderObject* o, const PaintIn
i.context->translate(-unzoomedRect.x(), -unzoomedRect.y());
}
- blink::Platform::current()->themeEngine()->paint(canvas, blink::WebThemeEngine::PartSliderTrack, getWebThemeState(this, o), blink::WebRect(unzoomedRect), &extraParams);
+ Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartSliderTrack, getWebThemeState(this, o), WebRect(unzoomedRect), &extraParams);
return false;
}
bool RenderThemeChromiumDefault::paintSliderThumb(RenderObject* o, const PaintInfo& i, const IntRect& rect)
{
- blink::WebThemeEngine::ExtraParams extraParams;
- blink::WebCanvas* canvas = i.context->canvas();
+ WebThemeEngine::ExtraParams extraParams;
+ WebCanvas* canvas = i.context->canvas();
extraParams.slider.vertical = o->style()->appearance() == SliderThumbVerticalPart;
extraParams.slider.inDrag = isPressed(o);
@@ -461,13 +461,13 @@ bool RenderThemeChromiumDefault::paintSliderThumb(RenderObject* o, const PaintIn
i.context->translate(-unzoomedRect.x(), -unzoomedRect.y());
}
- blink::Platform::current()->themeEngine()->paint(canvas, blink::WebThemeEngine::PartSliderThumb, getWebThemeState(this, o), blink::WebRect(unzoomedRect), &extraParams);
+ Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartSliderThumb, getWebThemeState(this, o), WebRect(unzoomedRect), &extraParams);
return false;
}
void RenderThemeChromiumDefault::adjustInnerSpinButtonStyle(RenderStyle* style, Element*) const
{
- IntSize size = blink::Platform::current()->themeEngine()->getSize(blink::WebThemeEngine::PartInnerSpinButton);
+ IntSize size = Platform::current()->themeEngine()->getSize(WebThemeEngine::PartInnerSpinButton);
style->setWidth(Length(size.width(), Fixed));
style->setMinWidth(Length(size.width(), Fixed));
@@ -475,12 +475,12 @@ void RenderThemeChromiumDefault::adjustInnerSpinButtonStyle(RenderStyle* style,
bool RenderThemeChromiumDefault::paintInnerSpinButton(RenderObject* o, const PaintInfo& i, const IntRect& rect)
{
- blink::WebThemeEngine::ExtraParams extraParams;
- blink::WebCanvas* canvas = i.context->canvas();
+ WebThemeEngine::ExtraParams extraParams;
+ WebCanvas* canvas = i.context->canvas();
extraParams.innerSpin.spinUp = (controlStatesForRenderer(o) & SpinUpControlState);
extraParams.innerSpin.readOnly = isReadOnlyControl(o);
- blink::Platform::current()->themeEngine()->paint(canvas, blink::WebThemeEngine::PartInnerSpinButton, getWebThemeState(this, o), blink::WebRect(rect), &extraParams);
+ Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartInnerSpinButton, getWebThemeState(this, o), WebRect(rect), &extraParams);
return false;
}
@@ -492,7 +492,7 @@ bool RenderThemeChromiumDefault::paintProgressBar(RenderObject* o, const PaintIn
RenderProgress* renderProgress = toRenderProgress(o);
IntRect valueRect = progressValueRectFor(renderProgress, rect);
- blink::WebThemeEngine::ExtraParams extraParams;
+ WebThemeEngine::ExtraParams extraParams;
extraParams.progressBar.determinate = renderProgress->isDeterminate();
extraParams.progressBar.valueRectX = valueRect.x();
extraParams.progressBar.valueRectY = valueRect.y();
@@ -500,8 +500,8 @@ bool RenderThemeChromiumDefault::paintProgressBar(RenderObject* o, const PaintIn
extraParams.progressBar.valueRectHeight = valueRect.height();
DirectionFlippingScope scope(o, i, rect);
- blink::WebCanvas* canvas = i.context->canvas();
- blink::Platform::current()->themeEngine()->paint(canvas, blink::WebThemeEngine::PartProgressBar, getWebThemeState(this, o), blink::WebRect(rect), &extraParams);
+ WebCanvas* canvas = i.context->canvas();
+ Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartProgressBar, getWebThemeState(this, o), WebRect(rect), &extraParams);
return false;
}
« no previous file with comments | « Source/core/rendering/RenderThemeChromiumAndroid.cpp ('k') | Source/core/rendering/RenderThemeChromiumMac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698