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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp

Issue 2426793002: Aura overlay scrollbars adjust color for dark backgrounds (Closed)
Patch Set: fix test Created 4 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 state = WebThemeEngine::StatePressed; 155 state = WebThemeEngine::StatePressed;
156 else if (scrollbar.hoveredPart() == ThumbPart) 156 else if (scrollbar.hoveredPart() == ThumbPart)
157 state = WebThemeEngine::StateHover; 157 state = WebThemeEngine::StateHover;
158 158
159 WebCanvas* canvas = context.canvas(); 159 WebCanvas* canvas = context.canvas();
160 160
161 WebThemeEngine::Part part = WebThemeEngine::PartScrollbarHorizontalThumb; 161 WebThemeEngine::Part part = WebThemeEngine::PartScrollbarHorizontalThumb;
162 if (scrollbar.orientation() == VerticalScrollbar) 162 if (scrollbar.orientation() == VerticalScrollbar)
163 part = WebThemeEngine::PartScrollbarVerticalThumb; 163 part = WebThemeEngine::PartScrollbarVerticalThumb;
164 164
165 blink::WebThemeEngine::ExtraParams params;
166 params.scrollbarThumb.scrollbarTheme =
167 static_cast<WebScrollbarOverlayColorTheme>(
168 scrollbar.getScrollbarOverlayColorTheme());
169
165 Platform::current()->themeEngine()->paint(canvas, part, state, WebRect(rect), 170 Platform::current()->themeEngine()->paint(canvas, part, state, WebRect(rect),
166 0); 171 &params);
167 } 172 }
168 173
169 ScrollbarPart ScrollbarThemeOverlay::hitTest( 174 ScrollbarPart ScrollbarThemeOverlay::hitTest(
170 const ScrollbarThemeClient& scrollbar, 175 const ScrollbarThemeClient& scrollbar,
171 const IntPoint& position) { 176 const IntPoint& position) {
172 if (m_allowHitTest == DisallowHitTest) 177 if (m_allowHitTest == DisallowHitTest)
173 return NoPart; 178 return NoPart;
174 179
175 return ScrollbarTheme::hitTest(scrollbar, position); 180 return ScrollbarTheme::hitTest(scrollbar, position);
176 } 181 }
177 182
178 ScrollbarThemeOverlay& ScrollbarThemeOverlay::mobileTheme() { 183 ScrollbarThemeOverlay& ScrollbarThemeOverlay::mobileTheme() {
179 static ScrollbarThemeOverlay* theme; 184 static ScrollbarThemeOverlay* theme;
180 if (!theme) { 185 if (!theme) {
181 WebThemeEngine::ScrollbarStyle style = {3, 3, 0x80808080}; // default style 186 WebThemeEngine::ScrollbarStyle style = {3, 3, 0x80808080}; // default style
182 if (Platform::current()->themeEngine()) { 187 if (Platform::current()->themeEngine()) {
183 Platform::current()->themeEngine()->getOverlayScrollbarStyle(&style); 188 Platform::current()->themeEngine()->getOverlayScrollbarStyle(&style);
184 } 189 }
185 theme = new ScrollbarThemeOverlay( 190 theme = new ScrollbarThemeOverlay(
186 style.thumbThickness, style.scrollbarMargin, 191 style.thumbThickness, style.scrollbarMargin,
187 ScrollbarThemeOverlay::DisallowHitTest, Color(style.color)); 192 ScrollbarThemeOverlay::DisallowHitTest, Color(style.color));
188 } 193 }
189 return *theme; 194 return *theme;
190 } 195 }
191 196
192 } // namespace blink 197 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollbarThemeMac.mm ('k') | third_party/WebKit/Source/web/AssertMatchingEnums.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698