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

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

Issue 1586983004: Revert of Scale scrollbar in use-zoom-for-dsf mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutScrollbar.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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 #include "platform/geometry/DoubleRect.h" 89 #include "platform/geometry/DoubleRect.h"
90 #include "platform/geometry/FloatRect.h" 90 #include "platform/geometry/FloatRect.h"
91 #include "platform/geometry/LayoutRect.h" 91 #include "platform/geometry/LayoutRect.h"
92 #include "platform/graphics/GraphicsContext.h" 92 #include "platform/graphics/GraphicsContext.h"
93 #include "platform/graphics/GraphicsLayer.h" 93 #include "platform/graphics/GraphicsLayer.h"
94 #include "platform/graphics/GraphicsLayerDebugInfo.h" 94 #include "platform/graphics/GraphicsLayerDebugInfo.h"
95 #include "platform/graphics/paint/CullRect.h" 95 #include "platform/graphics/paint/CullRect.h"
96 #include "platform/graphics/paint/PaintController.h" 96 #include "platform/graphics/paint/PaintController.h"
97 #include "platform/scheduler/CancellableTaskFactory.h" 97 #include "platform/scheduler/CancellableTaskFactory.h"
98 #include "platform/scroll/ScrollAnimatorBase.h" 98 #include "platform/scroll/ScrollAnimatorBase.h"
99 #include "platform/scroll/ScrollbarTheme.h"
100 #include "platform/text/TextStream.h" 99 #include "platform/text/TextStream.h"
101 #include "public/platform/WebDisplayItemList.h" 100 #include "public/platform/WebDisplayItemList.h"
102 #include "public/platform/WebFrameScheduler.h" 101 #include "public/platform/WebFrameScheduler.h"
103 #include "wtf/CurrentTime.h" 102 #include "wtf/CurrentTime.h"
104 #include "wtf/StdLibExtras.h" 103 #include "wtf/StdLibExtras.h"
105 #include "wtf/TemporaryChange.h" 104 #include "wtf/TemporaryChange.h"
106 105
107 namespace blink { 106 namespace blink {
108 107
109 using namespace HTMLNames; 108 using namespace HTMLNames;
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 } 502 }
504 503
505 PassRefPtrWillBeRawPtr<Scrollbar> FrameView::createScrollbar(ScrollbarOrientatio n orientation) 504 PassRefPtrWillBeRawPtr<Scrollbar> FrameView::createScrollbar(ScrollbarOrientatio n orientation)
506 { 505 {
507 Element* customScrollbarElement = nullptr; 506 Element* customScrollbarElement = nullptr;
508 LocalFrame* customScrollbarFrame = nullptr; 507 LocalFrame* customScrollbarFrame = nullptr;
509 if (shouldUseCustomScrollbars(customScrollbarElement, customScrollbarFrame)) 508 if (shouldUseCustomScrollbars(customScrollbarElement, customScrollbarFrame))
510 return LayoutScrollbar::createCustomScrollbar(this, orientation, customS crollbarElement, customScrollbarFrame); 509 return LayoutScrollbar::createCustomScrollbar(this, orientation, customS crollbarElement, customScrollbarFrame);
511 510
512 // Nobody set a custom style, so we just use a native scrollbar. 511 // Nobody set a custom style, so we just use a native scrollbar.
513 return Scrollbar::create(this, orientation, RegularScrollbar, &frame().page( )->chromeClient()); 512 return Scrollbar::create(this, orientation, RegularScrollbar);
514 } 513 }
515 514
516 void FrameView::setContentsSize(const IntSize& size) 515 void FrameView::setContentsSize(const IntSize& size)
517 { 516 {
518 if (size == contentsSize()) 517 if (size == contentsSize())
519 return; 518 return;
520 519
521 m_contentsSize = size; 520 m_contentsSize = size;
522 updateScrollbars(scrollOffsetDouble()); 521 updateScrollbars(scrollOffsetDouble());
523 ScrollableArea::contentsResized(); 522 ScrollableArea::contentsResized();
(...skipping 2703 matching lines...) Expand 10 before | Expand all | Expand 10 after
3227 if (hScroll == ScrollbarAuto) 3226 if (hScroll == ScrollbarAuto)
3228 newHasHorizontalScrollbar = false; 3227 newHasHorizontalScrollbar = false;
3229 if (vScroll == ScrollbarAuto) 3228 if (vScroll == ScrollbarAuto)
3230 newHasVerticalScrollbar = false; 3229 newHasVerticalScrollbar = false;
3231 } 3230 }
3232 } 3231 }
3233 3232
3234 void FrameView::updateScrollbarGeometry() 3233 void FrameView::updateScrollbarGeometry()
3235 { 3234 {
3236 if (m_horizontalScrollbar) { 3235 if (m_horizontalScrollbar) {
3237 int thickness = m_horizontalScrollbar->scrollbarThickness();
3238 int clientWidth = visibleWidth(); 3236 int clientWidth = visibleWidth();
3239 IntRect oldRect(m_horizontalScrollbar->frameRect()); 3237 IntRect oldRect(m_horizontalScrollbar->frameRect());
3240 IntRect hBarRect((shouldPlaceVerticalScrollbarOnLeft() && m_verticalScro llbar) ? m_verticalScrollbar->width() : 0, 3238 IntRect hBarRect((shouldPlaceVerticalScrollbarOnLeft() && m_verticalScro llbar) ? m_verticalScrollbar->width() : 0,
3241 height() - thickness, 3239 height() - m_horizontalScrollbar->height(),
3242 width() - (m_verticalScrollbar ? m_verticalScrollbar->width() : 0), 3240 width() - (m_verticalScrollbar ? m_verticalScrollbar->width() : 0),
3243 thickness); 3241 m_horizontalScrollbar->height());
3244 m_horizontalScrollbar->setFrameRect(adjustScrollbarRectForResizer(hBarRe ct, *m_horizontalScrollbar)); 3242 m_horizontalScrollbar->setFrameRect(adjustScrollbarRectForResizer(hBarRe ct, *m_horizontalScrollbar));
3245 if (oldRect != m_horizontalScrollbar->frameRect()) 3243 if (oldRect != m_horizontalScrollbar->frameRect())
3246 setScrollbarNeedsPaintInvalidation(HorizontalScrollbar); 3244 setScrollbarNeedsPaintInvalidation(HorizontalScrollbar);
3247 3245
3248 m_horizontalScrollbar->setEnabled(contentsWidth() > clientWidth); 3246 m_horizontalScrollbar->setEnabled(contentsWidth() > clientWidth);
3249 m_horizontalScrollbar->setProportion(clientWidth, contentsWidth()); 3247 m_horizontalScrollbar->setProportion(clientWidth, contentsWidth());
3250 m_horizontalScrollbar->offsetDidChange(); 3248 m_horizontalScrollbar->offsetDidChange();
3251 } 3249 }
3252 3250
3253 if (m_verticalScrollbar) { 3251 if (m_verticalScrollbar) {
3254 int thickness = m_verticalScrollbar->scrollbarThickness();
3255 int clientHeight = visibleHeight(); 3252 int clientHeight = visibleHeight();
3256 IntRect oldRect(m_verticalScrollbar->frameRect()); 3253 IntRect oldRect(m_verticalScrollbar->frameRect());
3257 IntRect vBarRect(shouldPlaceVerticalScrollbarOnLeft() ? 0 : (width() - t hickness), 3254 IntRect vBarRect(shouldPlaceVerticalScrollbarOnLeft() ? 0 : (width() - m _verticalScrollbar->width()),
3258 0, 3255 0,
3259 thickness, 3256 m_verticalScrollbar->width(),
3260 height() - (m_horizontalScrollbar ? m_horizontalScrollbar->height() : 0)); 3257 height() - (m_horizontalScrollbar ? m_horizontalScrollbar->height() : 0));
3261 m_verticalScrollbar->setFrameRect(adjustScrollbarRectForResizer(vBarRect , *m_verticalScrollbar)); 3258 m_verticalScrollbar->setFrameRect(adjustScrollbarRectForResizer(vBarRect , *m_verticalScrollbar));
3262 if (oldRect != m_verticalScrollbar->frameRect()) 3259 if (oldRect != m_verticalScrollbar->frameRect())
3263 setScrollbarNeedsPaintInvalidation(VerticalScrollbar); 3260 setScrollbarNeedsPaintInvalidation(VerticalScrollbar);
3264 3261
3265 m_verticalScrollbar->setEnabled(contentsHeight() > clientHeight); 3262 m_verticalScrollbar->setEnabled(contentsHeight() > clientHeight);
3266 m_verticalScrollbar->setProportion(clientHeight, contentsHeight()); 3263 m_verticalScrollbar->setProportion(clientHeight, contentsHeight());
3267 m_verticalScrollbar->offsetDidChange(); 3264 m_verticalScrollbar->offsetDidChange();
3268 } 3265 }
3269 } 3266 }
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
4027 return m_hiddenForThrottling && m_crossOriginForThrottling; 4024 return m_hiddenForThrottling && m_crossOriginForThrottling;
4028 } 4025 }
4029 4026
4030 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const 4027 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const
4031 { 4028 {
4032 ASSERT(layoutView()); 4029 ASSERT(layoutView());
4033 return *layoutView(); 4030 return *layoutView();
4034 } 4031 }
4035 4032
4036 } // namespace blink 4033 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutScrollbar.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698