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

Side by Side Diff: Source/core/frame/FrameView.cpp

Issue 702913002: Updating custom scrollbar style (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: addressed review comments by rune Created 6 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 | « Source/core/frame/FrameView.h ('k') | Source/core/rendering/RenderBox.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) 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
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 bool didStyleChange = false;
329 if (m_horizontalScrollbar && m_horizontalScrollbar->isCustomScrollbar()) {
330 m_horizontalScrollbar->styleChanged();
331 didStyleChange = true;
332 }
333 if (m_verticalScrollbar && m_verticalScrollbar->isCustomScrollbar()) {
334 m_verticalScrollbar->styleChanged();
335 didStyleChange = true;
336 }
337 if (didStyleChange) {
338 updateScrollbarGeometry();
339 updateScrollCorner();
340 positionScrollbarLayers();
341 }
342 }
343
326 void FrameView::recalculateScrollbarOverlayStyle() 344 void FrameView::recalculateScrollbarOverlayStyle()
327 { 345 {
328 ScrollbarOverlayStyle oldOverlayStyle = scrollbarOverlayStyle(); 346 ScrollbarOverlayStyle oldOverlayStyle = scrollbarOverlayStyle();
329 ScrollbarOverlayStyle overlayStyle = ScrollbarOverlayStyleDefault; 347 ScrollbarOverlayStyle overlayStyle = ScrollbarOverlayStyleDefault;
330 348
331 Color backgroundColor = documentBackgroundColor(); 349 Color backgroundColor = documentBackgroundColor();
332 // Reduce the background color from RGB to a lightness value 350 // Reduce the background color from RGB to a lightness value
333 // and determine which scrollbar style to use based on a lightness 351 // and determine which scrollbar style to use based on a lightness
334 // heuristic. 352 // heuristic.
335 double hue, saturation, lightness; 353 double hue, saturation, lightness;
(...skipping 3598 matching lines...) Expand 10 before | Expand all | Expand 10 after
3934 return; 3952 return;
3935 3953
3936 ScrollableArea::setScrollOrigin(origin); 3954 ScrollableArea::setScrollOrigin(origin);
3937 3955
3938 // Update if the scroll origin changes, since our position will be different if the content size did not change. 3956 // Update if the scroll origin changes, since our position will be different if the content size did not change.
3939 if (updatePositionAtAll && updatePositionSynchronously) 3957 if (updatePositionAtAll && updatePositionSynchronously)
3940 updateScrollbars(scrollOffsetDouble()); 3958 updateScrollbars(scrollOffsetDouble());
3941 } 3959 }
3942 3960
3943 } // namespace blink 3961 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/rendering/RenderBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698