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

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

Issue 2426793002: Aura overlay scrollbars adjust color for dark backgrounds (Closed)
Patch Set: fix 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 /* 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 DrawingRecorder recorder(gc, scrollbar, DisplayItem::kScrollbarThumb, rect); 333 DrawingRecorder recorder(gc, scrollbar, DisplayItem::kScrollbarThumb, rect);
334 334
335 WebThemeEngine::State state; 335 WebThemeEngine::State state;
336 WebCanvas* canvas = gc.canvas(); 336 WebCanvas* canvas = gc.canvas();
337 if (scrollbar.pressedPart() == ThumbPart) 337 if (scrollbar.pressedPart() == ThumbPart)
338 state = WebThemeEngine::StatePressed; 338 state = WebThemeEngine::StatePressed;
339 else if (scrollbar.hoveredPart() == ThumbPart) 339 else if (scrollbar.hoveredPart() == ThumbPart)
340 state = WebThemeEngine::StateHover; 340 state = WebThemeEngine::StateHover;
341 else 341 else
342 state = WebThemeEngine::StateNormal; 342 state = WebThemeEngine::StateNormal;
343
343 Platform::current()->themeEngine()->paint( 344 Platform::current()->themeEngine()->paint(
344 canvas, scrollbar.orientation() == HorizontalScrollbar 345 canvas, scrollbar.orientation() == HorizontalScrollbar
345 ? WebThemeEngine::PartScrollbarHorizontalThumb 346 ? WebThemeEngine::PartScrollbarHorizontalThumb
346 : WebThemeEngine::PartScrollbarVerticalThumb, 347 : WebThemeEngine::PartScrollbarVerticalThumb,
347 state, WebRect(rect), 0); 348 state, WebRect(rect), 0);
bokan 2016/10/21 22:46:44 Nit: nullptr
348 } 349 }
349 350
350 bool ScrollbarThemeAura::shouldRepaintAllPartsOnInvalidation() const { 351 bool ScrollbarThemeAura::shouldRepaintAllPartsOnInvalidation() const {
351 // This theme can separately handle thumb invalidation. 352 // This theme can separately handle thumb invalidation.
352 return false; 353 return false;
353 } 354 }
354 355
355 ScrollbarPart ScrollbarThemeAura::invalidateOnThumbPositionChange( 356 ScrollbarPart ScrollbarThemeAura::invalidateOnThumbPositionChange(
356 const ScrollbarThemeClient& scrollbar, 357 const ScrollbarThemeClient& scrollbar,
357 float oldPosition, 358 float oldPosition,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 } 392 }
392 393
393 // HorizontalScrollbar 394 // HorizontalScrollbar
394 int squareSize = scrollbar.height(); 395 int squareSize = scrollbar.height();
395 return IntSize( 396 return IntSize(
396 scrollbar.width() < 2 * squareSize ? scrollbar.width() / 2 : squareSize, 397 scrollbar.width() < 2 * squareSize ? scrollbar.width() / 2 : squareSize,
397 squareSize); 398 squareSize);
398 } 399 }
399 400
400 } // namespace blink 401 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698