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

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

Issue 2096633002: Adds scroll position/scale emulation to DevTools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes issues with visual viewport scroll override, mainFrameSize on scale override, clamps position… Created 4 years, 5 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 class Node; 70 class Node;
71 class LayoutAnalyzer; 71 class LayoutAnalyzer;
72 class LayoutBox; 72 class LayoutBox;
73 class LayoutEmbeddedObject; 73 class LayoutEmbeddedObject;
74 class LayoutObject; 74 class LayoutObject;
75 class LayoutReplaced; 75 class LayoutReplaced;
76 class LayoutScrollbarPart; 76 class LayoutScrollbarPart;
77 class LayoutView; 77 class LayoutView;
78 class PaintInvalidationState; 78 class PaintInvalidationState;
79 class Page; 79 class Page;
80 class ScrollAndScaleEmulator;
80 class ScrollingCoordinator; 81 class ScrollingCoordinator;
81 class TracedValue; 82 class TracedValue;
82 struct AnnotatedRegionValue; 83 struct AnnotatedRegionValue;
83 struct CompositedSelection; 84 struct CompositedSelection;
84 85
85 typedef unsigned long long DOMTimeStamp; 86 typedef unsigned long long DOMTimeStamp;
86 87
87 class CORE_EXPORT FrameView final : public Widget, public PaintInvalidationCapab leScrollableArea { 88 class CORE_EXPORT FrameView final : public Widget, public PaintInvalidationCapab leScrollableArea {
88 USING_GARBAGE_COLLECTED_MIXIN(FrameView); 89 USING_GARBAGE_COLLECTED_MIXIN(FrameView);
89 90
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 184
184 // Scale used to convert incoming input events. 185 // Scale used to convert incoming input events.
185 float inputEventsScaleFactor() const; 186 float inputEventsScaleFactor() const;
186 187
187 // Offset used to convert incoming input events while emulating device metic s. 188 // Offset used to convert incoming input events while emulating device metic s.
188 IntSize inputEventsOffsetForEmulation() const; 189 IntSize inputEventsOffsetForEmulation() const;
189 void setInputEventsTransformForEmulation(const IntSize&, float); 190 void setInputEventsTransformForEmulation(const IntSize&, float);
190 191
191 void setScrollPosition(const DoublePoint&, ScrollType, ScrollBehavior = Scro llBehaviorInstant) override; 192 void setScrollPosition(const DoublePoint&, ScrollType, ScrollBehavior = Scro llBehaviorInstant) override;
192 193
194 // Override the scroll position with values from the emulator. Passing |null ptr| clears override.
195 void setScrollAndScaleEmulator(const RefPtr<ScrollAndScaleEmulator>&);
196
193 void didUpdateElasticOverscroll(); 197 void didUpdateElasticOverscroll();
194 198
195 void viewportSizeChanged(bool widthChanged, bool heightChanged); 199 void viewportSizeChanged(bool widthChanged, bool heightChanged);
196 200
197 AtomicString mediaType() const; 201 AtomicString mediaType() const;
198 void setMediaType(const AtomicString&); 202 void setMediaType(const AtomicString&);
199 void adjustMediaTypeForPrinting(bool printing); 203 void adjustMediaTypeForPrinting(bool printing);
200 204
201 WebDisplayMode displayMode() { return m_displayMode; } 205 WebDisplayMode displayMode() { return m_displayMode; }
202 void setDisplayMode(WebDisplayMode); 206 void setDisplayMode(WebDisplayMode);
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 void adjustScrollbarOpacity(); 752 void adjustScrollbarOpacity();
749 void adjustScrollPositionFromUpdateScrollbars(); 753 void adjustScrollPositionFromUpdateScrollbars();
750 bool visualViewportSuppliesScrollbars() const; 754 bool visualViewportSuppliesScrollbars() const;
751 755
752 IntRect rectToCopyOnScroll() const; 756 IntRect rectToCopyOnScroll() const;
753 757
754 bool isFrameViewScrollbar(const Widget* child) const { return horizontalScro llbar() == child || verticalScrollbar() == child; } 758 bool isFrameViewScrollbar(const Widget* child) const { return horizontalScro llbar() == child || verticalScrollbar() == child; }
755 759
756 ScrollingCoordinator* scrollingCoordinator() const; 760 ScrollingCoordinator* scrollingCoordinator() const;
757 761
762 IntPoint calculateMinimumScrollPosition() const;
763 IntPoint calculateMaximumScrollPosition() const;
764
758 void prepareLayoutAnalyzer(); 765 void prepareLayoutAnalyzer();
759 std::unique_ptr<TracedValue> analyzerCounters(); 766 std::unique_ptr<TracedValue> analyzerCounters();
760 767
761 // LayoutObject for the viewport-defining element (see Document::viewportDef iningElement). 768 // LayoutObject for the viewport-defining element (see Document::viewportDef iningElement).
762 LayoutObject* viewportLayoutObject(); 769 LayoutObject* viewportLayoutObject();
763 770
764 void collectAnnotatedRegions(LayoutObject&, Vector<AnnotatedRegionValue>&) c onst; 771 void collectAnnotatedRegions(LayoutObject&, Vector<AnnotatedRegionValue>&) c onst;
765 772
766 template <typename Function> void forAllNonThrottledFrameViews(const Functio n&); 773 template <typename Function> void forAllNonThrottledFrameViews(const Functio n&);
767 774
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 877
871 bool m_horizontalScrollbarLock; 878 bool m_horizontalScrollbarLock;
872 bool m_verticalScrollbarLock; 879 bool m_verticalScrollbarLock;
873 880
874 ChildrenWidgetSet m_children; 881 ChildrenWidgetSet m_children;
875 882
876 DoubleSize m_pendingScrollDelta; 883 DoubleSize m_pendingScrollDelta;
877 DoublePoint m_scrollPosition; 884 DoublePoint m_scrollPosition;
878 IntSize m_contentsSize; 885 IntSize m_contentsSize;
879 886
887 RefPtr<ScrollAndScaleEmulator> m_scrollAndScaleEmulator;
888
880 int m_scrollbarsAvoidingResizer; 889 int m_scrollbarsAvoidingResizer;
881 bool m_scrollbarsSuppressed; 890 bool m_scrollbarsSuppressed;
882 891
883 bool m_inUpdateScrollbars; 892 bool m_inUpdateScrollbars;
884 893
885 std::unique_ptr<LayoutAnalyzer> m_analyzer; 894 std::unique_ptr<LayoutAnalyzer> m_analyzer;
886 895
887 // Mark if something has changed in the mapping from Frame to GraphicsLayer 896 // Mark if something has changed in the mapping from Frame to GraphicsLayer
888 // and the Frame Timing regions should be recalculated. 897 // and the Frame Timing regions should be recalculated.
889 bool m_frameTimingRequestsDirty; 898 bool m_frameTimingRequestsDirty;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) 964 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold)
956 setIsVisuallyNonEmpty(); 965 setIsVisuallyNonEmpty();
957 } 966 }
958 967
959 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView()); 968 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView());
960 DEFINE_TYPE_CASTS(FrameView, ScrollableArea, scrollableArea, scrollableArea->isF rameView(), scrollableArea.isFrameView()); 969 DEFINE_TYPE_CASTS(FrameView, ScrollableArea, scrollableArea, scrollableArea->isF rameView(), scrollableArea.isFrameView());
961 970
962 } // namespace blink 971 } // namespace blink
963 972
964 #endif // FrameView_h 973 #endif // FrameView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698