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

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: update 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 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.scrollbarStyle = static_cast<WebThemeEngine::ScrollbarOverlayStyle>(
167 scrollbar.getScrollbarOverlayStyle());
168
165 Platform::current()->themeEngine()->paint(canvas, part, state, WebRect(rect), 169 Platform::current()->themeEngine()->paint(canvas, part, state, WebRect(rect),
166 0); 170 &params);
167 } 171 }
168 172
169 ScrollbarPart ScrollbarThemeOverlay::hitTest( 173 ScrollbarPart ScrollbarThemeOverlay::hitTest(
170 const ScrollbarThemeClient& scrollbar, 174 const ScrollbarThemeClient& scrollbar,
171 const IntPoint& position) { 175 const IntPoint& position) {
172 if (m_allowHitTest == DisallowHitTest) 176 if (m_allowHitTest == DisallowHitTest)
173 return NoPart; 177 return NoPart;
174 178
175 return ScrollbarTheme::hitTest(scrollbar, position); 179 return ScrollbarTheme::hitTest(scrollbar, position);
176 } 180 }
177 181
178 ScrollbarThemeOverlay& ScrollbarThemeOverlay::mobileTheme() { 182 ScrollbarThemeOverlay& ScrollbarThemeOverlay::mobileTheme() {
179 static ScrollbarThemeOverlay* theme; 183 static ScrollbarThemeOverlay* theme;
180 if (!theme) { 184 if (!theme) {
181 WebThemeEngine::ScrollbarStyle style = {3, 3, 0x80808080}; // default style 185 WebThemeEngine::ScrollbarStyle style = {3, 3, 0x80808080}; // default style
182 if (Platform::current()->themeEngine()) { 186 if (Platform::current()->themeEngine()) {
183 Platform::current()->themeEngine()->getOverlayScrollbarStyle(&style); 187 Platform::current()->themeEngine()->getOverlayScrollbarStyle(&style);
184 } 188 }
185 theme = new ScrollbarThemeOverlay( 189 theme = new ScrollbarThemeOverlay(
186 style.thumbThickness, style.scrollbarMargin, 190 style.thumbThickness, style.scrollbarMargin,
187 ScrollbarThemeOverlay::DisallowHitTest, Color(style.color)); 191 ScrollbarThemeOverlay::DisallowHitTest, Color(style.color));
188 } 192 }
189 return *theme; 193 return *theme;
190 } 194 }
191 195
192 } // namespace blink 196 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698