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

Side by Side Diff: Source/platform/scroll/ScrollView.h

Issue 621653002: Don't call into ScrollView from Scrollbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@resizer
Patch Set: Created 6 years, 2 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, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Holger Hans Peter Freyther 3 * Copyright (C) 2009 Holger Hans Peter Freyther
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 // Functions for child manipulation and inspection. 65 // Functions for child manipulation and inspection.
66 const HashSet<RefPtr<Widget> >* children() const { return &m_children; } 66 const HashSet<RefPtr<Widget> >* children() const { return &m_children; }
67 virtual void addChild(PassRefPtr<Widget>); 67 virtual void addChild(PassRefPtr<Widget>);
68 virtual void removeChild(Widget*); 68 virtual void removeChild(Widget*);
69 69
70 // If the scroll view does not use a native widget, then it will have cross- platform Scrollbars. These functions 70 // If the scroll view does not use a native widget, then it will have cross- platform Scrollbars. These functions
71 // can be used to obtain those scrollbars. 71 // can be used to obtain those scrollbars.
72 virtual Scrollbar* horizontalScrollbar() const OVERRIDE { return m_horizonta lScrollbar.get(); } 72 virtual Scrollbar* horizontalScrollbar() const OVERRIDE { return m_horizonta lScrollbar.get(); }
73 virtual Scrollbar* verticalScrollbar() const OVERRIDE { return m_verticalScr ollbar.get(); } 73 virtual Scrollbar* verticalScrollbar() const OVERRIDE { return m_verticalScr ollbar.get(); }
74 bool isScrollViewScrollbar(const Widget* child) const { return horizontalScr ollbar() == child || verticalScrollbar() == child; } 74 virtual bool isScrollViewScrollbar(const Widget* child) const OVERRIDE { ret urn horizontalScrollbar() == child || verticalScrollbar() == child; }
75 75
76 void positionScrollbarLayers(); 76 void positionScrollbarLayers();
77 77
78 // Functions for setting and retrieving the scrolling mode in each axis (hor izontal/vertical). The mode has values of 78 // Functions for setting and retrieving the scrolling mode in each axis (hor izontal/vertical). The mode has values of
79 // AlwaysOff, AlwaysOn, and Auto. AlwaysOff means never show a scrollbar, Al waysOn means always show a scrollbar. 79 // AlwaysOff, AlwaysOn, and Auto. AlwaysOff means never show a scrollbar, Al waysOn means always show a scrollbar.
80 // Auto means show a scrollbar only when one is needed. 80 // Auto means show a scrollbar only when one is needed.
81 // Note that for platforms with native widgets, these modes are considered a dvisory. In other words the underlying native 81 // Note that for platforms with native widgets, these modes are considered a dvisory. In other words the underlying native
82 // widget may choose not to honor the requested modes. 82 // widget may choose not to honor the requested modes.
83 void setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalM ode, bool horizontalLock = false, bool verticalLock = false); 83 void setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalM ode, bool horizontalLock = false, bool verticalLock = false);
84 void setHorizontalScrollbarMode(ScrollbarMode mode, bool lock = false) { set ScrollbarModes(mode, verticalScrollbarMode(), lock, verticalScrollbarLock()); } 84 void setHorizontalScrollbarMode(ScrollbarMode mode, bool lock = false) { set ScrollbarModes(mode, verticalScrollbarMode(), lock, verticalScrollbarLock()); }
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 // Subclassed by FrameView to check the writing-mode of the document. 276 // Subclassed by FrameView to check the writing-mode of the document.
277 virtual bool isVerticalDocument() const { return true; } 277 virtual bool isVerticalDocument() const { return true; }
278 virtual bool isFlippedDocument() const { return false; } 278 virtual bool isFlippedDocument() const { return false; }
279 279
280 enum ComputeScrollbarExistenceOption { 280 enum ComputeScrollbarExistenceOption {
281 FirstPass, 281 FirstPass,
282 Incremental 282 Incremental
283 }; 283 };
284 void computeScrollbarExistence(bool& newHasHorizontalScrollbar, bool& newHas VerticalScrollbar, const IntSize& docSize, ComputeScrollbarExistenceOption = Fir stPass) const; 284 void computeScrollbarExistence(bool& newHasHorizontalScrollbar, bool& newHas VerticalScrollbar, const IntSize& docSize, ComputeScrollbarExistenceOption = Fir stPass) const;
285 void updateScrollbarGeometry(); 285 void updateScrollbarGeometry();
286 IntRect adjustScrollbarRectForResizer(const IntRect&, Scrollbar*);
286 287
287 // Called to update the scrollbars to accurately reflect the state of the vi ew. 288 // Called to update the scrollbars to accurately reflect the state of the vi ew.
288 void updateScrollbars(const IntSize& desiredOffset); 289 void updateScrollbars(const IntSize& desiredOffset);
289 290
290 IntSize excludeScrollbars(const IntSize&) const; 291 IntSize excludeScrollbars(const IntSize&) const;
291 292
292 class InUpdateScrollbarsScope { 293 class InUpdateScrollbarsScope {
293 public: 294 public:
294 explicit InUpdateScrollbarsScope(ScrollView* view) 295 explicit InUpdateScrollbarsScope(ScrollView* view)
295 : m_scope(view->m_inUpdateScrollbars, true) 296 : m_scope(view->m_inUpdateScrollbars, true)
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 341
341 void calculateOverhangAreasForPainting(IntRect& horizontalOverhangRect, IntR ect& verticalOverhangRect); 342 void calculateOverhangAreasForPainting(IntRect& horizontalOverhangRect, IntR ect& verticalOverhangRect);
342 void updateOverhangAreas(); 343 void updateOverhangAreas();
343 }; // class ScrollView 344 }; // class ScrollView
344 345
345 DEFINE_TYPE_CASTS(ScrollView, Widget, widget, widget->isScrollView(), widget.isS crollView()); 346 DEFINE_TYPE_CASTS(ScrollView, Widget, widget, widget->isScrollView(), widget.isS crollView());
346 347
347 } // namespace blink 348 } // namespace blink
348 349
349 #endif // ScrollView_h 350 #endif // ScrollView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698