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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollbarThemeAura.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) 2008, 2009, Google Inc. All rights reserved. 2 * Copyright (c) 2008, 2009, 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 } 124 }
125 125
126 return PartPaintingParams(paintPart, state); 126 return PartPaintingParams(paintPart, state);
127 } 127 }
128 128
129 } // namespace 129 } // namespace
130 130
131 ScrollbarTheme& ScrollbarTheme::nativeTheme() 131 ScrollbarTheme& ScrollbarTheme::nativeTheme()
132 { 132 {
133 if (RuntimeEnabledFeatures::overlayScrollbarsEnabled()) { 133 if (RuntimeEnabledFeatures::overlayScrollbarsEnabled()) {
134 if (RuntimeEnabledFeatures::hideScrollbarsEnabled()) {
135 DEFINE_STATIC_LOCAL(ScrollbarThemeOverlay, theme, (0, 0, ScrollbarTh emeOverlay::DisallowHitTest, Color()));
136 return theme;
137 }
134 DEFINE_STATIC_LOCAL(ScrollbarThemeOverlay, theme, (10, 0, ScrollbarTheme Overlay::AllowHitTest)); 138 DEFINE_STATIC_LOCAL(ScrollbarThemeOverlay, theme, (10, 0, ScrollbarTheme Overlay::AllowHitTest));
135 return theme; 139 return theme;
136 } 140 }
137 141
138 DEFINE_STATIC_LOCAL(ScrollbarThemeAura, theme, ()); 142 DEFINE_STATIC_LOCAL(ScrollbarThemeAura, theme, ());
139 return theme; 143 return theme;
140 } 144 }
141 145
142 int ScrollbarThemeAura::scrollbarThickness(ScrollbarControlSize controlSize) 146 int ScrollbarThemeAura::scrollbarThickness(ScrollbarControlSize controlSize)
143 { 147 {
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 int squareSize = scrollbar.width(); 345 int squareSize = scrollbar.width();
342 return IntSize(squareSize, scrollbar.height() < 2 * squareSize ? scrollb ar.height() / 2 : squareSize); 346 return IntSize(squareSize, scrollbar.height() < 2 * squareSize ? scrollb ar.height() / 2 : squareSize);
343 } 347 }
344 348
345 // HorizontalScrollbar 349 // HorizontalScrollbar
346 int squareSize = scrollbar.height(); 350 int squareSize = scrollbar.height();
347 return IntSize(scrollbar.width() < 2 * squareSize ? scrollbar.width() / 2 : squareSize, squareSize); 351 return IntSize(scrollbar.width() < 2 * squareSize ? scrollbar.width() / 2 : squareSize, squareSize);
348 } 352 }
349 353
350 } // namespace blink 354 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698