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

Side by Side Diff: ui/native_theme/native_theme_aura.cc

Issue 2467693002: Implement overlay scrollbar fade out for non-composited scrollers. (Closed)
Patch Set: overlay-scrollbar-mouse-capture now works on Mac 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/native_theme/native_theme_aura.h" 5 #include "ui/native_theme/native_theme_aura.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 if (state == kDisabled) 190 if (state == kDisabled)
191 return; 191 return;
192 192
193 TRACE_EVENT0("blink", "NativeThemeAura::PaintScrollbarThumb"); 193 TRACE_EVENT0("blink", "NativeThemeAura::PaintScrollbarThumb");
194 194
195 gfx::Rect thumb_rect(rect); 195 gfx::Rect thumb_rect(rect);
196 SkColor thumb_color; 196 SkColor thumb_color;
197 SkAlpha thumb_alpha = ThumbAlphaForState(state); 197 SkAlpha thumb_alpha = ThumbAlphaForState(state);
198 198
199 if (IsOverlayScrollbarEnabled()) { 199 if (IsOverlayScrollbarEnabled()) {
200 if (state == kDisabled)
skobes 2016/11/02 21:02:43 This seems redundant with an identical check at th
bokan 2016/11/02 22:41:57 Doh! Missed that :)
201 return;
202
200 thumb_color = kOverlayScrollbarThumbColor[theme]; 203 thumb_color = kOverlayScrollbarThumbColor[theme];
201 204
202 // In overlay mode, draw a stroke (border). 205 // In overlay mode, draw a stroke (border).
203 constexpr int kStrokeWidth = kOverlayScrollbarStrokeWidth; 206 constexpr int kStrokeWidth = kOverlayScrollbarStrokeWidth;
204 SkPaint paint; 207 SkPaint paint;
205 paint.setColor( 208 paint.setColor(
206 SkColorSetA(kOverlayScrollbarStrokeColor[theme], thumb_alpha)); 209 SkColorSetA(kOverlayScrollbarStrokeColor[theme], thumb_alpha));
207 paint.setStyle(SkPaint::kStroke_Style); 210 paint.setStyle(SkPaint::kStroke_Style);
208 paint.setStrokeWidth(kStrokeWidth); 211 paint.setStrokeWidth(kStrokeWidth);
209 212
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 // branch return 0 for parts that don't exist or assert NOTREACHED. 267 // branch return 0 for parts that don't exist or assert NOTREACHED.
265 // crbug.com/657159. 268 // crbug.com/657159.
266 break; 269 break;
267 } 270 }
268 } 271 }
269 272
270 return NativeThemeBase::GetPartSize(part, state, extra); 273 return NativeThemeBase::GetPartSize(part, state, extra);
271 } 274 }
272 275
273 } // namespace ui 276 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698