 Chromium Code Reviews
 Chromium Code Reviews Issue 702913002:
  Updating custom scrollbar style   (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master
    
  
    Issue 702913002:
  Updating custom scrollbar style   (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master| OLD | NEW | 
|---|---|
| 1 /* | 1 /* | 
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> | 
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> | 
| 5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> | 
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 
| 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 
| 9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. | 
| 10 * | 10 * | 
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 316 Scrollbar* verticalBar = verticalScrollbar(); | 316 Scrollbar* verticalBar = verticalScrollbar(); | 
| 317 if (verticalBar && verticalBar->isCustomScrollbar()) | 317 if (verticalBar && verticalBar->isCustomScrollbar()) | 
| 318 setHasVerticalScrollbar(false); | 318 setHasVerticalScrollbar(false); | 
| 319 | 319 | 
| 320 if (m_scrollCorner) { | 320 if (m_scrollCorner) { | 
| 321 m_scrollCorner->destroy(); | 321 m_scrollCorner->destroy(); | 
| 322 m_scrollCorner = nullptr; | 322 m_scrollCorner = nullptr; | 
| 323 } | 323 } | 
| 324 } | 324 } | 
| 325 | 325 | 
| 326 void FrameView::recalculateCustomScrollbarStyle() | |
| 327 { | |
| 328 if (hasCustomScrollbars()) { | |
| 
skobes
2014/11/07 17:54:41
You don't need this check since you are checking i
 
MuVen
2014/11/07 18:31:19
Done.
 
MuVen
2014/11/07 18:31:19
Done.
 | |
| 329 bool didStyleRecalculated = false; | |
| 
skobes
2014/11/07 17:54:41
Call this "didStyleChange".
 
MuVen
2014/11/07 18:31:19
Done.
 | |
| 330 if (m_horizontalScrollbar && m_horizontalScrollbar->isCustomScrollbar()) { | |
| 331 m_horizontalScrollbar->styleChanged(); | |
| 332 didStyleRecalculated = true; | |
| 333 } | |
| 334 if (m_verticalScrollbar && m_verticalScrollbar->isCustomScrollbar()) { | |
| 335 m_verticalScrollbar->styleChanged(); | |
| 336 didStyleRecalculated = true; | |
| 337 } | |
| 338 if (didStyleRecalculated) { | |
| 339 updateScrollbarGeometry(); | |
| 340 updateScrollCorner(); | |
| 341 positionScrollbarLayers(); | |
| 342 } | |
| 343 } | |
| 344 } | |
| 345 | |
| 326 void FrameView::recalculateScrollbarOverlayStyle() | 346 void FrameView::recalculateScrollbarOverlayStyle() | 
| 327 { | 347 { | 
| 328 ScrollbarOverlayStyle oldOverlayStyle = scrollbarOverlayStyle(); | 348 ScrollbarOverlayStyle oldOverlayStyle = scrollbarOverlayStyle(); | 
| 329 ScrollbarOverlayStyle overlayStyle = ScrollbarOverlayStyleDefault; | 349 ScrollbarOverlayStyle overlayStyle = ScrollbarOverlayStyleDefault; | 
| 330 | 350 | 
| 331 Color backgroundColor = documentBackgroundColor(); | 351 Color backgroundColor = documentBackgroundColor(); | 
| 332 // Reduce the background color from RGB to a lightness value | 352 // Reduce the background color from RGB to a lightness value | 
| 333 // and determine which scrollbar style to use based on a lightness | 353 // and determine which scrollbar style to use based on a lightness | 
| 334 // heuristic. | 354 // heuristic. | 
| 335 double hue, saturation, lightness; | 355 double hue, saturation, lightness; | 
| (...skipping 3598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3934 return; | 3954 return; | 
| 3935 | 3955 | 
| 3936 ScrollableArea::setScrollOrigin(origin); | 3956 ScrollableArea::setScrollOrigin(origin); | 
| 3937 | 3957 | 
| 3938 // Update if the scroll origin changes, since our position will be different if the content size did not change. | 3958 // Update if the scroll origin changes, since our position will be different if the content size did not change. | 
| 3939 if (updatePositionAtAll && updatePositionSynchronously) | 3959 if (updatePositionAtAll && updatePositionSynchronously) | 
| 3940 updateScrollbars(scrollOffsetDouble()); | 3960 updateScrollbars(scrollOffsetDouble()); | 
| 3941 } | 3961 } | 
| 3942 | 3962 | 
| 3943 } // namespace blink | 3963 } // namespace blink | 
| OLD | NEW |