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

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

Issue 1158673006: Replace various ScrollableArea scroll methods with setScrollPosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 6 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) 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // |unobscuredRect| receives the clip rect that is not clipped to the root w indow. It may be nullptr. 163 // |unobscuredRect| receives the clip rect that is not clipped to the root w indow. It may be nullptr.
164 IntRect clipRectsForFrameOwner(const HTMLFrameOwnerElement*, IntRect* unobsc uredRect) const; 164 IntRect clipRectsForFrameOwner(const HTMLFrameOwnerElement*, IntRect* unobsc uredRect) const;
165 165
166 // Scale used to convert incoming input events. 166 // Scale used to convert incoming input events.
167 float inputEventsScaleFactor() const; 167 float inputEventsScaleFactor() const;
168 168
169 // Offset used to convert incoming input events while emulating device metic s. 169 // Offset used to convert incoming input events while emulating device metic s.
170 IntSize inputEventsOffsetForEmulation() const; 170 IntSize inputEventsOffsetForEmulation() const;
171 void setInputEventsTransformForEmulation(const IntSize&, float); 171 void setInputEventsTransformForEmulation(const IntSize&, float);
172 172
173 virtual void setScrollPosition(const DoublePoint&, ScrollBehavior = ScrollBe haviorInstant) override; 173 virtual void setScrollPosition(const DoublePoint&, ScrollType, ScrollBehavio r = ScrollBehaviorInstant) override;
174 174
175 FloatSize elasticOverscroll() const { return m_elasticOverscroll; } 175 FloatSize elasticOverscroll() const { return m_elasticOverscroll; }
176 void setElasticOverscroll(const FloatSize&); 176 void setElasticOverscroll(const FloatSize&);
177 177
178 void viewportSizeChanged(bool widthChanged, bool heightChanged); 178 void viewportSizeChanged(bool widthChanged, bool heightChanged);
179 179
180 AtomicString mediaType() const; 180 AtomicString mediaType() const;
181 void setMediaType(const AtomicString&); 181 void setMediaType(const AtomicString&);
182 void adjustMediaTypeForPrinting(bool printing); 182 void adjustMediaTypeForPrinting(bool printing);
183 183
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 virtual void getTickmarks(Vector<IntRect>&) const override; 344 virtual void getTickmarks(Vector<IntRect>&) const override;
345 void scrollTo(const DoublePoint&); 345 void scrollTo(const DoublePoint&);
346 virtual IntRect scrollableAreaBoundingBox() const override; 346 virtual IntRect scrollableAreaBoundingBox() const override;
347 virtual bool scrollAnimatorEnabled() const override; 347 virtual bool scrollAnimatorEnabled() const override;
348 virtual bool usesCompositedScrolling() const override; 348 virtual bool usesCompositedScrolling() const override;
349 virtual GraphicsLayer* layerForScrolling() const override; 349 virtual GraphicsLayer* layerForScrolling() const override;
350 virtual GraphicsLayer* layerForHorizontalScrollbar() const override; 350 virtual GraphicsLayer* layerForHorizontalScrollbar() const override;
351 virtual GraphicsLayer* layerForVerticalScrollbar() const override; 351 virtual GraphicsLayer* layerForVerticalScrollbar() const override;
352 virtual GraphicsLayer* layerForScrollCorner() const override; 352 virtual GraphicsLayer* layerForScrollCorner() const override;
353 virtual int scrollSize(ScrollbarOrientation) const override; 353 virtual int scrollSize(ScrollbarOrientation) const override;
354 virtual void setScrollOffset(const IntPoint&) override;
355 virtual void setScrollOffset(const DoublePoint&) override;
356 virtual bool isScrollCornerVisible() const override; 354 virtual bool isScrollCornerVisible() const override;
357 virtual bool userInputScrollable(ScrollbarOrientation) const override; 355 virtual bool userInputScrollable(ScrollbarOrientation) const override;
358 virtual bool shouldPlaceVerticalScrollbarOnLeft() const override; 356 virtual bool shouldPlaceVerticalScrollbarOnLeft() const override;
359 virtual LayoutRect scrollIntoView( 357 virtual LayoutRect scrollIntoView(
360 const LayoutRect& rectInContent, 358 const LayoutRect& rectInContent,
361 const ScrollAlignment& alignX, 359 const ScrollAlignment& alignX,
362 const ScrollAlignment& alignY) override; 360 const ScrollAlignment& alignY) override;
363 361
364 // The window that hosts the FrameView. The FrameView will communicate scrol ls and repaints to the 362 // The window that hosts the FrameView. The FrameView will communicate scrol ls and repaints to the
365 // host window in the window's coordinate space. 363 // host window in the window's coordinate space.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 IntSize scrollOffset() const { return toIntSize(visibleContentRect().locatio n()); } // Gets the scrolled position as an IntSize. Convenient for adding to ot her sizes. 429 IntSize scrollOffset() const { return toIntSize(visibleContentRect().locatio n()); } // Gets the scrolled position as an IntSize. Convenient for adding to ot her sizes.
432 DoubleSize scrollOffsetDouble() const { return DoubleSize(m_scrollPosition.x (), m_scrollPosition.y()); } 430 DoubleSize scrollOffsetDouble() const { return DoubleSize(m_scrollPosition.x (), m_scrollPosition.y()); }
433 DoubleSize pendingScrollDelta() const { return m_pendingScrollDelta; } 431 DoubleSize pendingScrollDelta() const { return m_pendingScrollDelta; }
434 virtual IntPoint minimumScrollPosition() const override; // The minimum posi tion we can be scrolled to. 432 virtual IntPoint minimumScrollPosition() const override; // The minimum posi tion we can be scrolled to.
435 int scrollX() const { return scrollPosition().x(); } 433 int scrollX() const { return scrollPosition().x(); }
436 int scrollY() const { return scrollPosition().y(); } 434 int scrollY() const { return scrollPosition().y(); }
437 435
438 void cacheCurrentScrollPosition() { m_cachedScrollPosition = scrollPositionD ouble(); } 436 void cacheCurrentScrollPosition() { m_cachedScrollPosition = scrollPositionD ouble(); }
439 DoublePoint cachedScrollPosition() const { return m_cachedScrollPosition; } 437 DoublePoint cachedScrollPosition() const { return m_cachedScrollPosition; }
440 438
441 // Functions for scrolling the view.
442 void scrollBy(const DoubleSize& s, ScrollBehavior behavior = ScrollBehaviorI nstant)
443 {
444 return setScrollPosition(scrollPositionDouble() + s, behavior);
445 }
446
447 // Scroll the actual contents of the view (either blitting or invalidating a s needed). 439 // Scroll the actual contents of the view (either blitting or invalidating a s needed).
448 void scrollContents(const IntSize& scrollDelta); 440 void scrollContents(const IntSize& scrollDelta);
449 441
450 // This gives us a means of blocking painting on our scrollbars until the fi rst layout has occurred. 442 // This gives us a means of blocking painting on our scrollbars until the fi rst layout has occurred.
451 void setScrollbarsSuppressed(bool suppressed, bool repaintOnUnsuppress = fal se); 443 void setScrollbarsSuppressed(bool suppressed, bool repaintOnUnsuppress = fal se);
452 bool scrollbarsSuppressed() const { return m_scrollbarsSuppressed; } 444 bool scrollbarsSuppressed() const { return m_scrollbarsSuppressed; }
453 445
454 bool drawPanScrollIcon() { return m_shouldDrawPanScrollIcon; } 446 bool drawPanScrollIcon() { return m_shouldDrawPanScrollIcon; }
455 447
456 // Methods for converting between this frame and other coordinate spaces. 448 // Methods for converting between this frame and other coordinate spaces.
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 explicit InUpdateScrollbarsScope(FrameView* view) 598 explicit InUpdateScrollbarsScope(FrameView* view)
607 : m_scope(view->m_inUpdateScrollbars, true) 599 : m_scope(view->m_inUpdateScrollbars, true)
608 { } 600 { }
609 private: 601 private:
610 TemporaryChange<bool> m_scope; 602 TemporaryChange<bool> m_scope;
611 }; 603 };
612 604
613 private: 605 private:
614 explicit FrameView(LocalFrame*); 606 explicit FrameView(LocalFrame*);
615 607
608 virtual void setScrollOffset(const IntPoint&, ScrollType) override;
609 virtual void setScrollOffset(const DoublePoint&, ScrollType) override;
610
616 void updateLayoutAndStyleForPaintingInternal(); 611 void updateLayoutAndStyleForPaintingInternal();
617 void invalidateTreeIfNeededRecursive(); 612 void invalidateTreeIfNeededRecursive();
618 void scrollContentsIfNeededRecursive(); 613 void scrollContentsIfNeededRecursive();
619 void updateLayoutAndStyleIfNeededRecursive(); 614 void updateLayoutAndStyleIfNeededRecursive();
620 615
621 void reset(); 616 void reset();
622 void init(); 617 void init();
623 618
624 void clearLayoutSubtreeRootsAndMarkContainingBlocks(); 619 void clearLayoutSubtreeRootsAndMarkContainingBlocks();
625 620
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 static const unsigned visualPixelThreshold = 32 * 32; 873 static const unsigned visualPixelThreshold = 32 * 32;
879 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) 874 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold)
880 setIsVisuallyNonEmpty(); 875 setIsVisuallyNonEmpty();
881 } 876 }
882 877
883 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView()); 878 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView());
884 879
885 } // namespace blink 880 } // namespace blink
886 881
887 #endif // FrameView_h 882 #endif // FrameView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698