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

Unified Diff: content/child/webthemeengine_impl_default.cc

Issue 2426793002: Aura overlay scrollbars adjust color for dark backgrounds (Closed)
Patch Set: fix test Created 4 years, 2 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
« no previous file with comments | « content/child/webthemeengine_impl_default.h ('k') | third_party/WebKit/Source/core/frame/FrameView.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webthemeengine_impl_default.cc
diff --git a/content/child/webthemeengine_impl_default.cc b/content/child/webthemeengine_impl_default.cc
index 7fa4ba7d6497c2d374257db255e91d283d2c24cc..d55bea603310f74659ac9c358ac27951ff60680a 100644
--- a/content/child/webthemeengine_impl_default.cc
+++ b/content/child/webthemeengine_impl_default.cc
@@ -14,6 +14,7 @@ using blink::WebCanvas;
using blink::WebColor;
using blink::WebRect;
using blink::WebThemeEngine;
+using blink::WebScrollbarOverlayColorTheme;
namespace content {
namespace {
@@ -78,6 +79,18 @@ static ui::NativeTheme::Part NativeThemePart(
}
}
+static ui::NativeTheme::ScrollbarOverlayColorTheme
+NativeThemeScrollbarOverlayColorTheme(WebScrollbarOverlayColorTheme theme) {
+ switch (theme) {
+ case WebScrollbarOverlayColorTheme::WebScrollbarOverlayColorThemeLight:
+ return ui::NativeTheme::ScrollbarOverlayColorThemeLight;
+ case WebScrollbarOverlayColorTheme::WebScrollbarOverlayColorThemeDark:
+ return ui::NativeTheme::ScrollbarOverlayColorThemeDark;
+ default:
+ return ui::NativeTheme::ScrollbarOverlayColorThemeDark;
+ }
+}
+
static ui::NativeTheme::State NativeThemeState(
WebThemeEngine::State state) {
switch (state) {
@@ -99,6 +112,9 @@ static void GetNativeThemeExtraParams(
WebThemeEngine::State state,
const WebThemeEngine::ExtraParams* extra_params,
ui::NativeTheme::ExtraParams* native_theme_extra_params) {
+ if (!extra_params)
+ return;
+
switch (part) {
case WebThemeEngine::PartScrollbarHorizontalTrack:
case WebThemeEngine::PartScrollbarVerticalTrack:
@@ -177,6 +193,12 @@ static void GetNativeThemeExtraParams(
native_theme_extra_params->progress_bar.value_rect_height =
extra_params->progressBar.valueRectHeight;
break;
+ case WebThemeEngine::PartScrollbarHorizontalThumb:
+ case WebThemeEngine::PartScrollbarVerticalThumb:
+ native_theme_extra_params->scrollbar_thumb.scrollbar_theme =
+ NativeThemeScrollbarOverlayColorTheme(
+ extra_params->scrollbarThumb.scrollbarTheme);
+ break;
default:
break; // Parts that have no extra params get here.
}
@@ -221,17 +243,6 @@ void WebThemeEngineImpl::paint(
native_theme_extra_params);
}
-void WebThemeEngineImpl::paintStateTransition(blink::WebCanvas* canvas,
- WebThemeEngine::Part part,
- WebThemeEngine::State startState,
- WebThemeEngine::State endState,
- double progress,
- const blink::WebRect& rect) {
- ui::NativeTheme::GetInstanceForWeb()->PaintStateTransition(
- canvas, NativeThemePart(part), NativeThemeState(startState),
- NativeThemeState(endState), progress, gfx::Rect(rect));
-}
-
#if defined(OS_WIN)
// static
void WebThemeEngineImpl::cacheScrollBarMetrics(
« no previous file with comments | « content/child/webthemeengine_impl_default.h ('k') | third_party/WebKit/Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698