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

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 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
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 if (hasCustomScrollbars()) {
329 if (m_horizontalScrollbar && m_horizontalScrollbar->isCustomScrollbar()) {
330 IntRect oldRect(m_horizontalScrollbar->frameRect());
331 m_horizontalScrollbar->styleChanged();
332 IntRect hBarRect((shouldPlaceVerticalScrollbarOnLeft() && m_vertical Scrollbar) ? m_verticalScrollbar->width() : 0,
333 height() - m_horizontalScrollbar->height(),
334 width() - (m_verticalScrollbar ? m_verticalScrollbar->width() : 0),
335 m_horizontalScrollbar->height());
336 m_horizontalScrollbar->setFrameRect(adjustScrollbarRectForResizer(hB arRect, m_horizontalScrollbar.get()));
skobes 2014/11/07 00:13:59 Calling Scrollbar::styleChanged() makes sense, but
MuVen 2014/11/07 09:46:59 instead of updateScrollbar, updateScrollbarGeometr
337 if (!m_scrollbarsSuppressed && oldRect != m_horizontalScrollbar->fra meRect())
338 m_horizontalScrollbar->invalidate();
339 }
340 if (m_verticalScrollbar && m_verticalScrollbar->isCustomScrollbar()) {
341 IntRect oldRect(m_verticalScrollbar->frameRect());
342 m_verticalScrollbar->styleChanged();
343 IntRect vBarRect(shouldPlaceVerticalScrollbarOnLeft() ? 0 : (width() - m_verticalScrollbar->width()),
344 0,
345 m_verticalScrollbar->width(),
346 height() - (m_horizontalScrollbar ? m_horizontalScrollbar->heigh t() : 0));
347 m_verticalScrollbar->setFrameRect(adjustScrollbarRectForResizer(vBar Rect, m_verticalScrollbar.get()));
348 if (!m_scrollbarsSuppressed && oldRect != m_verticalScrollbar->frame Rect())
349 m_verticalScrollbar->invalidate();
350 }
351 }
352 }
353
326 void FrameView::recalculateScrollbarOverlayStyle() 354 void FrameView::recalculateScrollbarOverlayStyle()
327 { 355 {
328 ScrollbarOverlayStyle oldOverlayStyle = scrollbarOverlayStyle(); 356 ScrollbarOverlayStyle oldOverlayStyle = scrollbarOverlayStyle();
329 ScrollbarOverlayStyle overlayStyle = ScrollbarOverlayStyleDefault; 357 ScrollbarOverlayStyle overlayStyle = ScrollbarOverlayStyleDefault;
330 358
331 Color backgroundColor = documentBackgroundColor(); 359 Color backgroundColor = documentBackgroundColor();
332 // Reduce the background color from RGB to a lightness value 360 // Reduce the background color from RGB to a lightness value
333 // and determine which scrollbar style to use based on a lightness 361 // and determine which scrollbar style to use based on a lightness
334 // heuristic. 362 // heuristic.
335 double hue, saturation, lightness; 363 double hue, saturation, lightness;
(...skipping 3598 matching lines...) Expand 10 before | Expand all | Expand 10 after
3934 return; 3962 return;
3935 3963
3936 ScrollableArea::setScrollOrigin(origin); 3964 ScrollableArea::setScrollOrigin(origin);
3937 3965
3938 // Update if the scroll origin changes, since our position will be different if the content size did not change. 3966 // Update if the scroll origin changes, since our position will be different if the content size did not change.
3939 if (updatePositionAtAll && updatePositionSynchronously) 3967 if (updatePositionAtAll && updatePositionSynchronously)
3940 updateScrollbars(scrollOffsetDouble()); 3968 updateScrollbars(scrollOffsetDouble());
3941 } 3969 }
3942 3970
3943 } // namespace blink 3971 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698