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

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

Issue 1672973002: ScrollableArea::pixelsPerLine should return viewport pixels in use-zoom-for-dsf mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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) 2004, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 , m_trackNeedsRepaint(true) 75 , m_trackNeedsRepaint(true)
76 , m_thumbNeedsRepaint(true) 76 , m_thumbNeedsRepaint(true)
77 { 77 {
78 m_theme.registerScrollbar(*this); 78 m_theme.registerScrollbar(*this);
79 79
80 // FIXME: This is ugly and would not be necessary if we fix cross-platform c ode to actually query for 80 // FIXME: This is ugly and would not be necessary if we fix cross-platform c ode to actually query for
81 // scrollbar thickness and use it when sizing scrollbars (rather than leavin g one dimension of the scrollbar 81 // scrollbar thickness and use it when sizing scrollbars (rather than leavin g one dimension of the scrollbar
82 // alone when sizing). 82 // alone when sizing).
83 int thickness = m_theme.scrollbarThickness(controlSize); 83 int thickness = m_theme.scrollbarThickness(controlSize);
84 if (m_hostWindow) 84 if (m_hostWindow)
85 thickness = m_hostWindow->windowToViewport(FloatRect(0, 0, thickness, 0) ).width(); 85 thickness = m_hostWindow->windowToViewportScalar(thickness);
86 Widget::setFrameRect(IntRect(0, 0, thickness, thickness)); 86 Widget::setFrameRect(IntRect(0, 0, thickness, thickness));
87 87
88 m_currentPos = scrollableAreaCurrentPos(); 88 m_currentPos = scrollableAreaCurrentPos();
89 } 89 }
90 90
91 Scrollbar::~Scrollbar() 91 Scrollbar::~Scrollbar()
92 { 92 {
93 m_theme.unregisterScrollbar(*this); 93 m_theme.unregisterScrollbar(*this);
94 } 94 }
95 95
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 m_enabled = e; 476 m_enabled = e;
477 theme().updateEnabledState(*this); 477 theme().updateEnabledState(*this);
478 setNeedsPaintInvalidation(AllParts); 478 setNeedsPaintInvalidation(AllParts);
479 } 479 }
480 480
481 int Scrollbar::scrollbarThickness() const 481 int Scrollbar::scrollbarThickness() const
482 { 482 {
483 int thickness = orientation() == HorizontalScrollbar ? height() : width(); 483 int thickness = orientation() == HorizontalScrollbar ? height() : width();
484 if (!thickness || !m_hostWindow) 484 if (!thickness || !m_hostWindow)
485 return thickness; 485 return thickness;
486 return m_hostWindow->windowToViewport(FloatRect(0, 0, m_theme.scrollbarThick ness(controlSize()), 0)).width(); 486 return m_hostWindow->windowToViewportScalar(m_theme.scrollbarThickness(contr olSize()));
487 } 487 }
488 488
489 489
490 bool Scrollbar::isOverlayScrollbar() const 490 bool Scrollbar::isOverlayScrollbar() const
491 { 491 {
492 return m_theme.usesOverlayScrollbars(); 492 return m_theme.usesOverlayScrollbars();
493 } 493 }
494 494
495 bool Scrollbar::shouldParticipateInHitTesting() 495 bool Scrollbar::shouldParticipateInHitTesting()
496 { 496 {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 invalidParts = AllParts; 580 invalidParts = AllParts;
581 if (invalidParts & ~ThumbPart) 581 if (invalidParts & ~ThumbPart)
582 m_trackNeedsRepaint = true; 582 m_trackNeedsRepaint = true;
583 if (invalidParts & ThumbPart) 583 if (invalidParts & ThumbPart)
584 m_thumbNeedsRepaint = true; 584 m_thumbNeedsRepaint = true;
585 if (m_scrollableArea) 585 if (m_scrollableArea)
586 m_scrollableArea->setScrollbarNeedsPaintInvalidation(orientation()); 586 m_scrollableArea->setScrollbarNeedsPaintInvalidation(orientation());
587 } 587 }
588 588
589 } // namespace blink 589 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698