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

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

Issue 2473163002: Fix tests to ship Aura overlay scrollbars for ChromeOS (Closed)
Patch Set: Flag Off - Removed DCHECKs in painting - Should pass all tests 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
« no previous file with comments | « third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 PaintArrow(canvas, rect, direction, arrow_color); 167 PaintArrow(canvas, rect, direction, arrow_color);
168 } 168 }
169 169
170 void NativeThemeAura::PaintScrollbarTrack( 170 void NativeThemeAura::PaintScrollbarTrack(
171 SkCanvas* canvas, 171 SkCanvas* canvas,
172 Part part, 172 Part part,
173 State state, 173 State state,
174 const ScrollbarTrackExtraParams& extra_params, 174 const ScrollbarTrackExtraParams& extra_params,
175 const gfx::Rect& rect) const { 175 const gfx::Rect& rect) const {
176 // Overlay Scrollbar should never paint a scrollbar track. 176 // Overlay Scrollbar should never paint a scrollbar track.
177 DCHECK(!IsOverlayScrollbarEnabled()); 177 // TODO(bokan/estade): Overlay scrollbars shouldn't be painting a scroll
178 // corner but Views code currently is unaware of Overlays. crbug.com/657159.
Evan Stade 2016/11/05 01:13:09 I don't think this is right. Native scrollbars sho
179 if (IsOverlayScrollbarEnabled())
180 return;
178 SkPaint paint; 181 SkPaint paint;
179 paint.setColor(kTrackColor); 182 paint.setColor(kTrackColor);
180 canvas->drawIRect(gfx::RectToSkIRect(rect), paint); 183 canvas->drawIRect(gfx::RectToSkIRect(rect), paint);
181 } 184 }
182 185
183 void NativeThemeAura::PaintScrollbarThumb( 186 void NativeThemeAura::PaintScrollbarThumb(
184 SkCanvas* canvas, 187 SkCanvas* canvas,
185 Part part, 188 Part part,
186 State state, 189 State state,
187 const gfx::Rect& rect, 190 const gfx::Rect& rect,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 233
231 SkPaint paint; 234 SkPaint paint;
232 paint.setColor(SkColorSetA(thumb_color, thumb_alpha)); 235 paint.setColor(SkColorSetA(thumb_color, thumb_alpha));
233 canvas->drawIRect(gfx::RectToSkIRect(thumb_rect), paint); 236 canvas->drawIRect(gfx::RectToSkIRect(thumb_rect), paint);
234 } 237 }
235 238
236 void NativeThemeAura::PaintScrollbarCorner(SkCanvas* canvas, 239 void NativeThemeAura::PaintScrollbarCorner(SkCanvas* canvas,
237 State state, 240 State state,
238 const gfx::Rect& rect) const { 241 const gfx::Rect& rect) const {
239 // Overlay Scrollbar should never paint a scrollbar corner. 242 // Overlay Scrollbar should never paint a scrollbar corner.
240 DCHECK(!IsOverlayScrollbarEnabled()); 243 // TODO(bokan/estade): Overlay scrollbars shouldn't be painting a scroll
244 // corner but Views code currently is unaware of Overlays. crbug.com/657159.
245 if (IsOverlayScrollbarEnabled())
246 return;
241 SkPaint paint; 247 SkPaint paint;
242 paint.setColor(SkColorSetRGB(0xDC, 0xDC, 0xDC)); 248 paint.setColor(SkColorSetRGB(0xDC, 0xDC, 0xDC));
243 canvas->drawIRect(RectToSkIRect(rect), paint); 249 canvas->drawIRect(RectToSkIRect(rect), paint);
244 } 250 }
245 251
246 gfx::Size NativeThemeAura::GetPartSize(Part part, 252 gfx::Size NativeThemeAura::GetPartSize(Part part,
247 State state, 253 State state,
248 const ExtraParams& extra) const { 254 const ExtraParams& extra) const {
249 if (IsOverlayScrollbarEnabled()) { 255 if (IsOverlayScrollbarEnabled()) {
250 constexpr int minimum_length = 256 constexpr int minimum_length =
(...skipping 13 matching lines...) Expand all
264 // branch return 0 for parts that don't exist or assert NOTREACHED. 270 // branch return 0 for parts that don't exist or assert NOTREACHED.
265 // crbug.com/657159. 271 // crbug.com/657159.
266 break; 272 break;
267 } 273 }
268 } 274 }
269 275
270 return NativeThemeBase::GetPartSize(part, state, extra); 276 return NativeThemeBase::GetPartSize(part, state, extra);
271 } 277 }
272 278
273 } // namespace ui 279 } // namespace ui
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698