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

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

Issue 1511003003: Use refs for non-null GraphicsContext, Scrollbar, etc. in scrollbar related code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarRemove
Patch Set: Created 5 years 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) 1997 Martin Jones (mjones@kde.org) 2 Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 (C) 1998 Waldo Bastian (bastian@kde.org) 3 (C) 1998 Waldo Bastian (bastian@kde.org)
4 (C) 1998, 1999 Torben Weis (weis@kde.org) 4 (C) 1998, 1999 Torben Weis (weis@kde.org)
5 (C) 1999 Lars Knoll (knoll@kde.org) 5 (C) 1999 Lars Knoll (knoll@kde.org)
6 (C) 1999 Antti Koivisto (koivisto@kde.org) 6 (C) 1999 Antti Koivisto (koivisto@kde.org)
7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
8 8
9 This library is free software; you can redistribute it and/or 9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public 10 modify it under the terms of the GNU Library General Public
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 typedef HashSet<LayoutBox*> ResizerAreaSet; 316 typedef HashSet<LayoutBox*> ResizerAreaSet;
317 void addResizerArea(LayoutBox&); 317 void addResizerArea(LayoutBox&);
318 void removeResizerArea(LayoutBox&); 318 void removeResizerArea(LayoutBox&);
319 const ResizerAreaSet* resizerAreas() const { return m_resizerAreas.get(); } 319 const ResizerAreaSet* resizerAreas() const { return m_resizerAreas.get(); }
320 320
321 bool shouldUseIntegerScrollOffset() const override; 321 bool shouldUseIntegerScrollOffset() const override;
322 322
323 bool isActive() const override; 323 bool isActive() const override;
324 324
325 // Override scrollbar notifications to update the AXObject cache. 325 // Override scrollbar notifications to update the AXObject cache.
326 void didAddScrollbar(Scrollbar*, ScrollbarOrientation) override; 326 void didAddScrollbar(Scrollbar&, ScrollbarOrientation) override;
327 327
328 // FIXME: This should probably be renamed as the 'inSubtreeLayout' parameter 328 // FIXME: This should probably be renamed as the 'inSubtreeLayout' parameter
329 // passed around the FrameView layout methods can be true while this returns 329 // passed around the FrameView layout methods can be true while this returns
330 // false. 330 // false.
331 bool isSubtreeLayout() const { return !m_layoutSubtreeRootList.isEmpty(); } 331 bool isSubtreeLayout() const { return !m_layoutSubtreeRootList.isEmpty(); }
332 332
333 // Sets the tickmarks for the FrameView, overriding the default behavior 333 // Sets the tickmarks for the FrameView, overriding the default behavior
334 // which is to display the tickmarks corresponding to find results. 334 // which is to display the tickmarks corresponding to find results.
335 // If |m_tickmarks| is empty, the default behavior is restored. 335 // If |m_tickmarks| is empty, the default behavior is restored.
336 void setTickmarks(const Vector<IntRect>& tickmarks) 336 void setTickmarks(const Vector<IntRect>& tickmarks)
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 IntPoint convertSelfToChild(const Widget* child, const IntPoint& point) cons t override 504 IntPoint convertSelfToChild(const Widget* child, const IntPoint& point) cons t override
505 { 505 {
506 IntPoint newPoint = point; 506 IntPoint newPoint = point;
507 if (!isFrameViewScrollbar(child)) 507 if (!isFrameViewScrollbar(child))
508 newPoint = frameToContents(point); 508 newPoint = frameToContents(point);
509 newPoint.moveBy(-child->location()); 509 newPoint.moveBy(-child->location());
510 return newPoint; 510 return newPoint;
511 } 511 }
512 512
513 // Widget override. Handles painting of the contents of the view as well as the scrollbars. 513 // Widget override. Handles painting of the contents of the view as well as the scrollbars.
514 void paint(GraphicsContext*, const CullRect&) const override; 514 void paint(GraphicsContext&, const CullRect&) const override;
515 void paint(GraphicsContext*, const GlobalPaintFlags, const CullRect&) const; 515 void paint(GraphicsContext&, const GlobalPaintFlags, const CullRect&) const;
516 void paintContents(GraphicsContext*, const GlobalPaintFlags, const IntRect& damageRect) const; 516 void paintContents(GraphicsContext&, const GlobalPaintFlags, const IntRect& damageRect) const;
517 517
518 // Widget overrides to ensure that our children's visibility status is kept up to date when we get shown and hidden. 518 // Widget overrides to ensure that our children's visibility status is kept up to date when we get shown and hidden.
519 void show() override; 519 void show() override;
520 void hide() override; 520 void hide() override;
521 void setParentVisible(bool) override; 521 void setParentVisible(bool) override;
522 522
523 bool isPointInScrollbarCorner(const IntPoint&); 523 bool isPointInScrollbarCorner(const IntPoint&);
524 bool scrollbarCornerPresent() const; 524 bool scrollbarCornerPresent() const;
525 IntRect scrollCornerRect() const override; 525 IntRect scrollCornerRect() const override;
526 526
527 IntRect convertFromScrollbarToContainingWidget(const Scrollbar*, const IntRe ct&) const override; 527 IntRect convertFromScrollbarToContainingWidget(const Scrollbar&, const IntRe ct&) const override;
528 IntRect convertFromContainingWidgetToScrollbar(const Scrollbar*, const IntRe ct&) const override; 528 IntRect convertFromContainingWidgetToScrollbar(const Scrollbar&, const IntRe ct&) const override;
529 IntPoint convertFromScrollbarToContainingWidget(const Scrollbar*, const IntP oint&) const override; 529 IntPoint convertFromScrollbarToContainingWidget(const Scrollbar&, const IntP oint&) const override;
530 IntPoint convertFromContainingWidgetToScrollbar(const Scrollbar*, const IntP oint&) const override; 530 IntPoint convertFromContainingWidgetToScrollbar(const Scrollbar&, const IntP oint&) const override;
531 531
532 bool isFrameView() const override { return true; } 532 bool isFrameView() const override { return true; }
533 533
534 DECLARE_VIRTUAL_TRACE(); 534 DECLARE_VIRTUAL_TRACE();
535 void notifyPageThatContentAreaWillPaint() const; 535 void notifyPageThatContentAreaWillPaint() const;
536 FrameView* parentFrameView() const; 536 FrameView* parentFrameView() const;
537 537
538 // Returns the scrollable area for the frame. For the root frame, this will 538 // Returns the scrollable area for the frame. For the root frame, this will
539 // be the RootFrameViewport, which adds pinch-zoom semantics to scrolling. 539 // be the RootFrameViewport, which adds pinch-zoom semantics to scrolling.
540 // For non-root frames, this will be the the ScrollableArea used by the 540 // For non-root frames, this will be the the ScrollableArea used by the
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 void scrollContentsIfNeeded(); 594 void scrollContentsIfNeeded();
595 595
596 void setScrollOrigin(const IntPoint&, bool updatePositionAtAll, bool updateP ositionSynchronously); 596 void setScrollOrigin(const IntPoint&, bool updatePositionAtAll, bool updateP ositionSynchronously);
597 597
598 enum ComputeScrollbarExistenceOption { 598 enum ComputeScrollbarExistenceOption {
599 FirstPass, 599 FirstPass,
600 Incremental 600 Incremental
601 }; 601 };
602 void computeScrollbarExistence(bool& newHasHorizontalScrollbar, bool& newHas VerticalScrollbar, const IntSize& docSize, ComputeScrollbarExistenceOption = Fir stPass) const; 602 void computeScrollbarExistence(bool& newHasHorizontalScrollbar, bool& newHas VerticalScrollbar, const IntSize& docSize, ComputeScrollbarExistenceOption = Fir stPass) const;
603 void updateScrollbarGeometry(); 603 void updateScrollbarGeometry();
604 IntRect adjustScrollbarRectForResizer(const IntRect&, Scrollbar*); 604 IntRect adjustScrollbarRectForResizer(const IntRect&, Scrollbar&);
605 605
606 // Called to update the scrollbars to accurately reflect the state of the vi ew. 606 // Called to update the scrollbars to accurately reflect the state of the vi ew.
607 void updateScrollbars(const DoubleSize& desiredOffset); 607 void updateScrollbars(const DoubleSize& desiredOffset);
608 608
609 class InUpdateScrollbarsScope { 609 class InUpdateScrollbarsScope {
610 STACK_ALLOCATED(); 610 STACK_ALLOCATED();
611 public: 611 public:
612 explicit InUpdateScrollbarsScope(FrameView* view) 612 explicit InUpdateScrollbarsScope(FrameView* view)
613 : m_scope(view->m_inUpdateScrollbars, true) 613 : m_scope(view->m_inUpdateScrollbars, true)
614 { } 614 { }
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 static const unsigned visualPixelThreshold = 32 * 32; 907 static const unsigned visualPixelThreshold = 32 * 32;
908 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) 908 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold)
909 setIsVisuallyNonEmpty(); 909 setIsVisuallyNonEmpty();
910 } 910 }
911 911
912 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView()); 912 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView());
913 913
914 } // namespace blink 914 } // namespace blink
915 915
916 #endif // FrameView_h 916 #endif // FrameView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698