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

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

Issue 2421913002: Change Aura overlay scrollbars from solid color to painted scrollbars. (Closed)
Patch Set: Few more fixes for pkasting@ 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
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.cc ('k') | ui/native_theme/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 state = WebThemeEngine::StateHover; 123 state = WebThemeEngine::StateHover;
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 if (RuntimeEnabledFeatures::overlayScrollbarsEnabled()) { 132 if (RuntimeEnabledFeatures::overlayScrollbarsEnabled()) {
133 int thickness = Platform::current()
jbroman 2016/10/18 20:39:26 nit: this fetches the thickness every time, even t
bokan 2016/10/18 21:59:52 Good catch, done.
134 ->themeEngine()
135 ->getSize(WebThemeEngine::PartScrollbarVerticalThumb)
136 .width;
133 DEFINE_STATIC_LOCAL(ScrollbarThemeOverlay, theme, 137 DEFINE_STATIC_LOCAL(ScrollbarThemeOverlay, theme,
134 (10, 0, ScrollbarThemeOverlay::AllowHitTest)); 138 (thickness, 0, ScrollbarThemeOverlay::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 // Horiz and Vert scrollbars are the same thickness. 147 // Horiz and Vert scrollbars are the same thickness.
144 // In unit tests we don't have the mock theme engine (because of layering 148 // In unit tests we don't have the mock theme engine (because of layering
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 } 387 }
384 388
385 // HorizontalScrollbar 389 // HorizontalScrollbar
386 int squareSize = scrollbar.height(); 390 int squareSize = scrollbar.height();
387 return IntSize( 391 return IntSize(
388 scrollbar.width() < 2 * squareSize ? scrollbar.width() / 2 : squareSize, 392 scrollbar.width() < 2 * squareSize ? scrollbar.width() / 2 : squareSize,
389 squareSize); 393 squareSize);
390 } 394 }
391 395
392 } // namespace blink 396 } // namespace blink
OLDNEW
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.cc ('k') | ui/native_theme/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698