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

Unified Diff: third_party/WebKit/Source/core/paint/ThemePainter.cpp

Issue 1690493002: Switch to LayoutThemeMobile when emulating mobile device in DevTools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Invalidate tapHighlightColor only Created 4 years, 10 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: third_party/WebKit/Source/core/paint/ThemePainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/ThemePainter.cpp b/third_party/WebKit/Source/core/paint/ThemePainter.cpp
index b9658837aaecb06d476887d1a4b191b592685f98..51b1d7866bcd3b457f7818f6ed976ea4ccee96fa 100644
--- a/third_party/WebKit/Source/core/paint/ThemePainter.cpp
+++ b/third_party/WebKit/Source/core/paint/ThemePainter.cpp
@@ -35,15 +35,12 @@
#include "core/paint/MediaControlsPainter.h"
#include "core/paint/PaintInfo.h"
#include "core/style/ComputedStyle.h"
+#include "platform/Theme.h"
#include "platform/graphics/GraphicsContextStateSaver.h"
#include "public/platform/Platform.h"
#include "public/platform/WebFallbackThemeEngine.h"
#include "public/platform/WebRect.h"
-#if USE(NEW_THEME)
-#include "platform/Theme.h"
-#endif
-
// The methods in this file are shared by all themes on every platform.
namespace blink {
@@ -60,6 +57,11 @@ static WebFallbackThemeEngine::State getWebFallbackThemeState(const LayoutObject
return WebFallbackThemeEngine::StateNormal;
}
+ThemePainter::ThemePainter(Theme* platformTheme)
+ : m_platformTheme(platformTheme)
+{
+}
+
bool ThemePainter::paint(const LayoutObject& o, const PaintInfo& paintInfo, const IntRect&r)
{
ControlPart part = o.styleRef().appearance();
@@ -67,24 +69,23 @@ bool ThemePainter::paint(const LayoutObject& o, const PaintInfo& paintInfo, cons
if (LayoutTheme::theme().shouldUseFallbackTheme(o.styleRef()))
return paintUsingFallbackTheme(o, paintInfo, r);
-#if USE(NEW_THEME)
- switch (part) {
- case CheckboxPart:
- case RadioPart:
- case PushButtonPart:
- case SquareButtonPart:
- case ButtonPart:
- case InnerSpinButtonPart:
- platformTheme()->paint(part, LayoutTheme::controlStatesForLayoutObject(o), const_cast<GraphicsContext&>(paintInfo.context), r, o.styleRef().effectiveZoom(), o.view()->frameView());
- return false;
- default:
- break;
+ if (m_platformTheme) {
+ switch (part) {
+ case CheckboxPart:
+ case RadioPart:
+ case PushButtonPart:
+ case SquareButtonPart:
+ case ButtonPart:
+ case InnerSpinButtonPart:
+ m_platformTheme->paint(part, LayoutTheme::controlStatesForLayoutObject(o), const_cast<GraphicsContext&>(paintInfo.context), r, o.styleRef().effectiveZoom(), o.view()->frameView());
+ return false;
+ default:
+ break;
+ }
}
-#endif
// Call the appropriate paint method based off the appearance value.
switch (part) {
-#if !USE(NEW_THEME)
case CheckboxPart:
return paintCheckbox(o, paintInfo, r);
case RadioPart:
@@ -95,7 +96,6 @@ bool ThemePainter::paint(const LayoutObject& o, const PaintInfo& paintInfo, cons
return paintButton(o, paintInfo, r);
case InnerSpinButtonPart:
return paintInnerSpinButton(o, paintInfo, r);
-#endif
case MenulistPart:
return paintMenuList(o, paintInfo, r);
case MeterPart:
« no previous file with comments | « third_party/WebKit/Source/core/paint/ThemePainter.h ('k') | third_party/WebKit/Source/core/paint/ThemePainterDefault.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698