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

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

Issue 2851853003: Use dark scrollbar theme for transparent frames. (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | third_party/WebKit/Source/web/tests/ScrollbarsTest.cpp » ('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) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google Inc. All rights reserved.
3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 Color background_color) { 429 Color background_color) {
430 ScrollbarOverlayColorTheme old_overlay_theme = 430 ScrollbarOverlayColorTheme old_overlay_theme =
431 GetScrollbarOverlayColorTheme(); 431 GetScrollbarOverlayColorTheme();
432 ScrollbarOverlayColorTheme overlay_theme = kScrollbarOverlayColorThemeDark; 432 ScrollbarOverlayColorTheme overlay_theme = kScrollbarOverlayColorThemeDark;
433 433
434 // Reduce the background color from RGB to a lightness value 434 // Reduce the background color from RGB to a lightness value
435 // and determine which scrollbar style to use based on a lightness 435 // and determine which scrollbar style to use based on a lightness
436 // heuristic. 436 // heuristic.
437 double hue, saturation, lightness; 437 double hue, saturation, lightness;
438 background_color.GetHSL(hue, saturation, lightness); 438 background_color.GetHSL(hue, saturation, lightness);
439 if (lightness <= .5) 439 if (lightness <= .5 && background_color.Alpha())
440 overlay_theme = kScrollbarOverlayColorThemeLight; 440 overlay_theme = kScrollbarOverlayColorThemeLight;
441 441
442 if (old_overlay_theme != overlay_theme) 442 if (old_overlay_theme != overlay_theme)
443 SetScrollbarOverlayColorTheme(overlay_theme); 443 SetScrollbarOverlayColorTheme(overlay_theme);
444 } 444 }
445 445
446 void ScrollableArea::SetScrollbarNeedsPaintInvalidation( 446 void ScrollableArea::SetScrollbarNeedsPaintInvalidation(
447 ScrollbarOrientation orientation) { 447 ScrollbarOrientation orientation) {
448 if (orientation == kHorizontalScrollbar) { 448 if (orientation == kHorizontalScrollbar) {
449 if (GraphicsLayer* graphics_layer = LayerForHorizontalScrollbar()) { 449 if (GraphicsLayer* graphics_layer = LayerForHorizontalScrollbar()) {
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 offset.y() - ScrollOrigin().Y()); 679 offset.y() - ScrollOrigin().Y());
680 SetScrollOffset(new_offset, kCompositorScroll); 680 SetScrollOffset(new_offset, kCompositorScroll);
681 } 681 }
682 682
683 DEFINE_TRACE(ScrollableArea) { 683 DEFINE_TRACE(ScrollableArea) {
684 visitor->Trace(scroll_animator_); 684 visitor->Trace(scroll_animator_);
685 visitor->Trace(programmatic_scroll_animator_); 685 visitor->Trace(programmatic_scroll_animator_);
686 } 686 }
687 687
688 } // namespace blink 688 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/ScrollbarsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698