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

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

Issue 2239313002: Hide non-composited native scrollbars. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add test. Created 4 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 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 if (m_allowHitTest == DisallowHitTest) 168 if (m_allowHitTest == DisallowHitTest)
169 return NoPart; 169 return NoPart;
170 170
171 return ScrollbarTheme::hitTest(scrollbar, position); 171 return ScrollbarTheme::hitTest(scrollbar, position);
172 } 172 }
173 173
174 ScrollbarThemeOverlay& ScrollbarThemeOverlay::mobileTheme() 174 ScrollbarThemeOverlay& ScrollbarThemeOverlay::mobileTheme()
175 { 175 {
176 static ScrollbarThemeOverlay* theme; 176 static ScrollbarThemeOverlay* theme;
177 if (!theme) { 177 if (!theme) {
178 WebThemeEngine::ScrollbarStyle style = { 3, 3, 0x80808080 }; // default style 178 if (RuntimeEnabledFeatures::hideScrollbarsEnabled()) {
179 if (Platform::current()->themeEngine()) { 179 theme = new ScrollbarThemeOverlay(0, 0, ScrollbarThemeOverlay::Disal lowHitTest, Color());
180 Platform::current()->themeEngine()->getOverlayScrollbarStyle(&style) ; 180 } else {
181 WebThemeEngine::ScrollbarStyle style = { 3, 3, 0x80808080 }; // defa ult style
182 if (Platform::current()->themeEngine()) {
183 Platform::current()->themeEngine()->getOverlayScrollbarStyle(&st yle);
184 }
185 theme = new ScrollbarThemeOverlay(style.thumbThickness, style.scroll barMargin, ScrollbarThemeOverlay::DisallowHitTest, Color(style.color));
181 } 186 }
182 theme = new ScrollbarThemeOverlay(style.thumbThickness, style.scrollbarM argin, ScrollbarThemeOverlay::DisallowHitTest, Color(style.color));
183 } 187 }
184 return *theme; 188 return *theme;
185 } 189 }
186 190
187 } // namespace blink 191 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698