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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 1560403002: Scale scrollbar in use-zoom-for-dsf mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unintentional change Created 4 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 static IntRect cornerRect(const LayoutBox& box, const Scrollbar* horizontalScrol lbar, const Scrollbar* verticalScrollbar, const IntRect& bounds) 235 static IntRect cornerRect(const LayoutBox& box, const Scrollbar* horizontalScrol lbar, const Scrollbar* verticalScrollbar, const IntRect& bounds)
236 { 236 {
237 int horizontalThickness; 237 int horizontalThickness;
238 int verticalThickness; 238 int verticalThickness;
239 if (!verticalScrollbar && !horizontalScrollbar) { 239 if (!verticalScrollbar && !horizontalScrollbar) {
240 // FIXME: This isn't right. We need to know the thickness of custom scro llbars 240 // FIXME: This isn't right. We need to know the thickness of custom scro llbars
241 // even when they don't exist in order to set the resizer square size pr operly. 241 // even when they don't exist in order to set the resizer square size pr operly.
242 horizontalThickness = ScrollbarTheme::theme().scrollbarThickness(); 242 horizontalThickness = ScrollbarTheme::theme().scrollbarThickness();
243 verticalThickness = horizontalThickness; 243 verticalThickness = horizontalThickness;
244 } else if (verticalScrollbar && !horizontalScrollbar) { 244 } else if (verticalScrollbar && !horizontalScrollbar) {
245 horizontalThickness = verticalScrollbar->width(); 245 horizontalThickness = verticalScrollbar->scrollbarThickness();
246 verticalThickness = horizontalThickness; 246 verticalThickness = horizontalThickness;
247 } else if (horizontalScrollbar && !verticalScrollbar) { 247 } else if (horizontalScrollbar && !verticalScrollbar) {
248 verticalThickness = horizontalScrollbar->height(); 248 verticalThickness = horizontalScrollbar->scrollbarThickness();
249 horizontalThickness = verticalThickness; 249 horizontalThickness = verticalThickness;
250 } else { 250 } else {
251 horizontalThickness = verticalScrollbar->width(); 251 horizontalThickness = verticalScrollbar->scrollbarThickness();
252 verticalThickness = horizontalScrollbar->height(); 252 verticalThickness = horizontalScrollbar->scrollbarThickness();
253 } 253 }
254 return IntRect(cornerStart(box, bounds.x(), bounds.maxX(), horizontalThickne ss), 254 return IntRect(cornerStart(box, bounds.x(), bounds.maxX(), horizontalThickne ss),
255 bounds.maxY() - verticalThickness - box.styleRef().borderBottomWidth(), 255 bounds.maxY() - verticalThickness - box.styleRef().borderBottomWidth(),
256 horizontalThickness, verticalThickness); 256 horizontalThickness, verticalThickness);
257 } 257 }
258 258
259 259
260 IntRect PaintLayerScrollableArea::scrollCornerRect() const 260 IntRect PaintLayerScrollableArea::scrollCornerRect() const
261 { 261 {
262 // We have a scrollbar corner when a scrollbar is visible and not filling th e entire length of the box. 262 // We have a scrollbar corner when a scrollbar is visible and not filling th e entire length of the box.
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1501 ASSERT(orientation == HorizontalScrollbar ? !m_hBarIsAttached : !m_vBarIsAtt ached); 1501 ASSERT(orientation == HorizontalScrollbar ? !m_hBarIsAttached : !m_vBarIsAtt ached);
1502 RefPtrWillBeRawPtr<Scrollbar> scrollbar = nullptr; 1502 RefPtrWillBeRawPtr<Scrollbar> scrollbar = nullptr;
1503 const LayoutObject& actualLayoutObject = layoutObjectForScrollbar(m_scrollab leArea->box()); 1503 const LayoutObject& actualLayoutObject = layoutObjectForScrollbar(m_scrollab leArea->box());
1504 bool hasCustomScrollbarStyle = actualLayoutObject.isBox() && actualLayoutObj ect.styleRef().hasPseudoStyle(SCROLLBAR); 1504 bool hasCustomScrollbarStyle = actualLayoutObject.isBox() && actualLayoutObj ect.styleRef().hasPseudoStyle(SCROLLBAR);
1505 if (hasCustomScrollbarStyle) { 1505 if (hasCustomScrollbarStyle) {
1506 scrollbar = LayoutScrollbar::createCustomScrollbar(m_scrollableArea.get( ), orientation, actualLayoutObject.node()); 1506 scrollbar = LayoutScrollbar::createCustomScrollbar(m_scrollableArea.get( ), orientation, actualLayoutObject.node());
1507 } else { 1507 } else {
1508 ScrollbarControlSize scrollbarSize = RegularScrollbar; 1508 ScrollbarControlSize scrollbarSize = RegularScrollbar;
1509 if (actualLayoutObject.styleRef().hasAppearance()) 1509 if (actualLayoutObject.styleRef().hasAppearance())
1510 scrollbarSize = LayoutTheme::theme().scrollbarControlSizeForPart(act ualLayoutObject.styleRef().appearance()); 1510 scrollbarSize = LayoutTheme::theme().scrollbarControlSizeForPart(act ualLayoutObject.styleRef().appearance());
1511 scrollbar = Scrollbar::create(m_scrollableArea.get(), orientation, scrol lbarSize); 1511 scrollbar = Scrollbar::create(m_scrollableArea.get(), orientation, scrol lbarSize, &m_scrollableArea->box().frame()->page()->chromeClient());
1512 if (orientation == HorizontalScrollbar) 1512 if (orientation == HorizontalScrollbar)
1513 m_scrollableArea->didAddScrollbar(*scrollbar, HorizontalScrollbar); 1513 m_scrollableArea->didAddScrollbar(*scrollbar, HorizontalScrollbar);
1514 else 1514 else
1515 m_scrollableArea->didAddScrollbar(*scrollbar, VerticalScrollbar); 1515 m_scrollableArea->didAddScrollbar(*scrollbar, VerticalScrollbar);
1516 } 1516 }
1517 m_scrollableArea->box().document().view()->addChild(scrollbar.get()); 1517 m_scrollableArea->box().document().view()->addChild(scrollbar.get());
1518 return scrollbar.release(); 1518 return scrollbar.release();
1519 } 1519 }
1520 1520
1521 void PaintLayerScrollableArea::ScrollbarManager::destroyScrollbar(ScrollbarOrien tation orientation) 1521 void PaintLayerScrollableArea::ScrollbarManager::destroyScrollbar(ScrollbarOrien tation orientation)
(...skipping 14 matching lines...) Expand all
1536 } 1536 }
1537 1537
1538 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) 1538 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager)
1539 { 1539 {
1540 visitor->trace(m_scrollableArea); 1540 visitor->trace(m_scrollableArea);
1541 visitor->trace(m_hBar); 1541 visitor->trace(m_hBar);
1542 visitor->trace(m_vBar); 1542 visitor->trace(m_vBar);
1543 } 1543 }
1544 1544
1545 } // namespace blink 1545 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/ChromeClient.cpp ('k') | third_party/WebKit/Source/platform/HostWindow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698