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

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

Issue 2721133003: Rename platform/Widget to platform/FrameViewBase in platform. (Closed)
Patch Set: Rename platform/Widget to platform/FrameViewBase in platform. Created 3 years, 9 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
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/Scrollbar.h ('k') | no next file » | 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) 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 m_theme.registerScrollbar(*this); 67 m_theme.registerScrollbar(*this);
68 68
69 // FIXME: This is ugly and would not be necessary if we fix cross-platform 69 // FIXME: This is ugly and would not be necessary if we fix cross-platform
70 // code to actually query for scrollbar thickness and use it when sizing 70 // code to actually query for scrollbar thickness and use it when sizing
71 // scrollbars (rather than leaving one dimension of the scrollbar alone when 71 // scrollbars (rather than leaving one dimension of the scrollbar alone when
72 // sizing). 72 // sizing).
73 int thickness = m_theme.scrollbarThickness(controlSize); 73 int thickness = m_theme.scrollbarThickness(controlSize);
74 m_themeScrollbarThickness = thickness; 74 m_themeScrollbarThickness = thickness;
75 if (m_hostWindow) 75 if (m_hostWindow)
76 thickness = m_hostWindow->windowToViewportScalar(thickness); 76 thickness = m_hostWindow->windowToViewportScalar(thickness);
77 Widget::setFrameRect(IntRect(0, 0, thickness, thickness)); 77 FrameViewBase::setFrameRect(IntRect(0, 0, thickness, thickness));
78 78
79 m_currentPos = scrollableAreaCurrentPos(); 79 m_currentPos = scrollableAreaCurrentPos();
80 } 80 }
81 81
82 Scrollbar::~Scrollbar() { 82 Scrollbar::~Scrollbar() {
83 m_theme.unregisterScrollbar(*this); 83 m_theme.unregisterScrollbar(*this);
84 } 84 }
85 85
86 DEFINE_TRACE(Scrollbar) { 86 DEFINE_TRACE(Scrollbar) {
87 visitor->trace(m_scrollableArea); 87 visitor->trace(m_scrollableArea);
88 visitor->trace(m_hostWindow); 88 visitor->trace(m_hostWindow);
89 Widget::trace(visitor); 89 FrameViewBase::trace(visitor);
90 } 90 }
91 91
92 void Scrollbar::setFrameRect(const IntRect& frameRect) { 92 void Scrollbar::setFrameRect(const IntRect& frameRect) {
93 if (frameRect == this->frameRect()) 93 if (frameRect == this->frameRect())
94 return; 94 return;
95 95
96 Widget::setFrameRect(frameRect); 96 FrameViewBase::setFrameRect(frameRect);
97 setNeedsPaintInvalidation(AllParts); 97 setNeedsPaintInvalidation(AllParts);
98 } 98 }
99 99
100 ScrollbarOverlayColorTheme Scrollbar::getScrollbarOverlayColorTheme() const { 100 ScrollbarOverlayColorTheme Scrollbar::getScrollbarOverlayColorTheme() const {
101 return m_scrollableArea ? m_scrollableArea->getScrollbarOverlayColorTheme() 101 return m_scrollableArea ? m_scrollableArea->getScrollbarOverlayColorTheme()
102 : ScrollbarOverlayColorThemeDark; 102 : ScrollbarOverlayColorThemeDark;
103 } 103 }
104 104
105 void Scrollbar::getTickmarks(Vector<IntRect>& tickmarks) const { 105 void Scrollbar::getTickmarks(Vector<IntRect>& tickmarks) const {
106 if (m_scrollableArea) 106 if (m_scrollableArea)
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 setNeedsPaintInvalidation(AllParts); 151 setNeedsPaintInvalidation(AllParts);
152 } 152 }
153 153
154 void Scrollbar::paint(GraphicsContext& context, 154 void Scrollbar::paint(GraphicsContext& context,
155 const CullRect& cullRect) const { 155 const CullRect& cullRect) const {
156 if (!cullRect.intersectsCullRect(frameRect())) 156 if (!cullRect.intersectsCullRect(frameRect()))
157 return; 157 return;
158 158
159 if (!theme().paint(*this, context, cullRect)) 159 if (!theme().paint(*this, context, cullRect))
160 Widget::paint(context, cullRect); 160 FrameViewBase::paint(context, cullRect);
161 } 161 }
162 162
163 void Scrollbar::autoscrollTimerFired(TimerBase*) { 163 void Scrollbar::autoscrollTimerFired(TimerBase*) {
164 autoscrollPressedPart(theme().autoscrollTimerDelay()); 164 autoscrollPressedPart(theme().autoscrollTimerDelay());
165 } 165 }
166 166
167 bool Scrollbar::thumbWillBeUnderMouse() const { 167 bool Scrollbar::thumbWillBeUnderMouse() const {
168 int thumbPos = theme().trackPosition(*this) + 168 int thumbPos = theme().trackPosition(*this) +
169 theme().thumbPosition(*this, scrollableAreaTargetPos()); 169 theme().thumbPosition(*this, scrollableAreaTargetPos());
170 int thumbLength = theme().thumbLength(*this); 170 int thumbLength = theme().thumbLength(*this);
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 566
567 bool Scrollbar::isWindowActive() const { 567 bool Scrollbar::isWindowActive() const {
568 return m_scrollableArea && m_scrollableArea->isActive(); 568 return m_scrollableArea && m_scrollableArea->isActive();
569 } 569 }
570 570
571 IntRect Scrollbar::convertToContainingWidget(const IntRect& localRect) const { 571 IntRect Scrollbar::convertToContainingWidget(const IntRect& localRect) const {
572 if (m_scrollableArea) 572 if (m_scrollableArea)
573 return m_scrollableArea->convertFromScrollbarToContainingWidget(*this, 573 return m_scrollableArea->convertFromScrollbarToContainingWidget(*this,
574 localRect); 574 localRect);
575 575
576 return Widget::convertToContainingWidget(localRect); 576 return FrameViewBase::convertToContainingWidget(localRect);
577 } 577 }
578 578
579 IntRect Scrollbar::convertFromContainingWidget( 579 IntRect Scrollbar::convertFromContainingWidget(
580 const IntRect& parentRect) const { 580 const IntRect& parentRect) const {
581 if (m_scrollableArea) 581 if (m_scrollableArea)
582 return m_scrollableArea->convertFromContainingWidgetToScrollbar(*this, 582 return m_scrollableArea->convertFromContainingWidgetToScrollbar(*this,
583 parentRect); 583 parentRect);
584 584
585 return Widget::convertFromContainingWidget(parentRect); 585 return FrameViewBase::convertFromContainingWidget(parentRect);
586 } 586 }
587 587
588 IntPoint Scrollbar::convertToContainingWidget( 588 IntPoint Scrollbar::convertToContainingWidget(
589 const IntPoint& localPoint) const { 589 const IntPoint& localPoint) const {
590 if (m_scrollableArea) 590 if (m_scrollableArea)
591 return m_scrollableArea->convertFromScrollbarToContainingWidget(*this, 591 return m_scrollableArea->convertFromScrollbarToContainingWidget(*this,
592 localPoint); 592 localPoint);
593 593
594 return Widget::convertToContainingWidget(localPoint); 594 return FrameViewBase::convertToContainingWidget(localPoint);
595 } 595 }
596 596
597 IntPoint Scrollbar::convertFromContainingWidget( 597 IntPoint Scrollbar::convertFromContainingWidget(
598 const IntPoint& parentPoint) const { 598 const IntPoint& parentPoint) const {
599 if (m_scrollableArea) 599 if (m_scrollableArea)
600 return m_scrollableArea->convertFromContainingWidgetToScrollbar( 600 return m_scrollableArea->convertFromContainingWidgetToScrollbar(
601 *this, parentPoint); 601 *this, parentPoint);
602 602
603 return Widget::convertFromContainingWidget(parentPoint); 603 return FrameViewBase::convertFromContainingWidget(parentPoint);
604 } 604 }
605 605
606 float Scrollbar::scrollableAreaCurrentPos() const { 606 float Scrollbar::scrollableAreaCurrentPos() const {
607 if (!m_scrollableArea) 607 if (!m_scrollableArea)
608 return 0; 608 return 0;
609 609
610 if (m_orientation == HorizontalScrollbar) { 610 if (m_orientation == HorizontalScrollbar) {
611 return m_scrollableArea->getScrollOffset().width() - 611 return m_scrollableArea->getScrollOffset().width() -
612 m_scrollableArea->minimumScrollOffset().width(); 612 m_scrollableArea->minimumScrollOffset().width();
613 } 613 }
(...skipping 20 matching lines...) Expand all
634 invalidParts = AllParts; 634 invalidParts = AllParts;
635 if (invalidParts & ~ThumbPart) 635 if (invalidParts & ~ThumbPart)
636 m_trackNeedsRepaint = true; 636 m_trackNeedsRepaint = true;
637 if (invalidParts & ThumbPart) 637 if (invalidParts & ThumbPart)
638 m_thumbNeedsRepaint = true; 638 m_thumbNeedsRepaint = true;
639 if (m_scrollableArea) 639 if (m_scrollableArea)
640 m_scrollableArea->setScrollbarNeedsPaintInvalidation(orientation()); 640 m_scrollableArea->setScrollbarNeedsPaintInvalidation(orientation());
641 } 641 }
642 642
643 } // namespace blink 643 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/Scrollbar.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698