| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 } | 48 } |
| 49 | 49 |
| 50 namespace blink { | 50 namespace blink { |
| 51 | 51 |
| 52 class FrameHost; | 52 class FrameHost; |
| 53 class GraphicsContext; | 53 class GraphicsContext; |
| 54 class GraphicsLayer; | 54 class GraphicsLayer; |
| 55 class IntRect; | 55 class IntRect; |
| 56 class IntSize; | 56 class IntSize; |
| 57 class LocalFrame; | 57 class LocalFrame; |
| 58 class ScrollAndScaleEmulator; |
| 58 | 59 |
| 59 // Represents the visual viewport the user is currently seeing the page through.
This | 60 // Represents the visual viewport the user is currently seeing the page through.
This |
| 60 // class corresponds to the InnerViewport on the compositor. It is a ScrollableA
rea; it's | 61 // class corresponds to the InnerViewport on the compositor. It is a ScrollableA
rea; it's |
| 61 // offset is set through the GraphicsLayer <-> CC sync mechanisms. Its contents
is the page's | 62 // offset is set through the GraphicsLayer <-> CC sync mechanisms. Its contents
is the page's |
| 62 // main FrameView, which corresponds to the outer viewport. The inner viewport i
s always contained | 63 // main FrameView, which corresponds to the outer viewport. The inner viewport i
s always contained |
| 63 // in the outer viewport and can pan within it. | 64 // in the outer viewport and can pan within it. |
| 64 class CORE_EXPORT VisualViewport final | 65 class CORE_EXPORT VisualViewport final |
| 65 : public GarbageCollectedFinalized<VisualViewport> | 66 : public GarbageCollectedFinalized<VisualViewport> |
| 66 , public GraphicsLayerClient | 67 , public GraphicsLayerClient |
| 67 , public ScrollableArea { | 68 , public ScrollableArea { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 93 void initializeScrollbars(); | 94 void initializeScrollbars(); |
| 94 | 95 |
| 95 // Sets the location of the visual viewport relative to the outer viewport.
The | 96 // Sets the location of the visual viewport relative to the outer viewport.
The |
| 96 // coordinates are in partial CSS pixels. | 97 // coordinates are in partial CSS pixels. |
| 97 void setLocation(const FloatPoint&); | 98 void setLocation(const FloatPoint&); |
| 98 // FIXME: This should be called moveBy | 99 // FIXME: This should be called moveBy |
| 99 void move(const FloatPoint&); | 100 void move(const FloatPoint&); |
| 100 void move(const FloatSize&); | 101 void move(const FloatSize&); |
| 101 FloatPoint location() const { return m_offset; } | 102 FloatPoint location() const { return m_offset; } |
| 102 | 103 |
| 104 // Override the scroll location and scale with values from the emulator. Pas
sing |nullptr| clears override. |
| 105 void setScrollAndScaleEmulator(const RefPtr<ScrollAndScaleEmulator>&); |
| 106 |
| 103 // Sets the size of the inner viewport when unscaled in CSS pixels. | 107 // Sets the size of the inner viewport when unscaled in CSS pixels. |
| 104 void setSize(const IntSize&); | 108 void setSize(const IntSize&); |
| 105 IntSize size() const { return m_size; } | 109 IntSize size() const { return m_size; } |
| 106 | 110 |
| 107 // Gets the scaled size, i.e. the viewport in root view space. | 111 // Gets the scaled size, i.e. the viewport in root view space. |
| 108 FloatSize visibleSize() const; | 112 FloatSize visibleSize() const; |
| 109 | 113 |
| 110 // Resets the viewport to initial state. | 114 // Resets the viewport to initial state. |
| 111 void reset(); | 115 void reset(); |
| 112 | 116 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 IntRect visibleContentRect(IncludeScrollbarsInRect = ExcludeScrollbars) cons
t override; | 178 IntRect visibleContentRect(IncludeScrollbarsInRect = ExcludeScrollbars) cons
t override; |
| 175 bool shouldUseIntegerScrollOffset() const override; | 179 bool shouldUseIntegerScrollOffset() const override; |
| 176 LayoutRect visualRectForScrollbarParts() const override { ASSERT_NOT_REACHED
(); return LayoutRect(); } | 180 LayoutRect visualRectForScrollbarParts() const override { ASSERT_NOT_REACHED
(); return LayoutRect(); } |
| 177 bool isActive() const override { return false; } | 181 bool isActive() const override { return false; } |
| 178 int scrollSize(ScrollbarOrientation) const override; | 182 int scrollSize(ScrollbarOrientation) const override; |
| 179 bool isScrollCornerVisible() const override { return false; } | 183 bool isScrollCornerVisible() const override { return false; } |
| 180 IntRect scrollCornerRect() const override { return IntRect(); } | 184 IntRect scrollCornerRect() const override { return IntRect(); } |
| 181 IntPoint scrollPosition() const override { return flooredIntPoint(m_offset);
} | 185 IntPoint scrollPosition() const override { return flooredIntPoint(m_offset);
} |
| 182 DoublePoint scrollPositionDouble() const override { return m_offset; } | 186 DoublePoint scrollPositionDouble() const override { return m_offset; } |
| 183 IntPoint minimumScrollPosition() const override; | 187 IntPoint minimumScrollPosition() const override; |
| 188 DoublePoint minimumScrollPositionDouble() const override; |
| 184 IntPoint maximumScrollPosition() const override; | 189 IntPoint maximumScrollPosition() const override; |
| 185 DoublePoint maximumScrollPositionDouble() const override; | 190 DoublePoint maximumScrollPositionDouble() const override; |
| 186 int visibleHeight() const override { return visibleRect().height(); } | 191 int visibleHeight() const override { return visibleRect().height(); } |
| 187 int visibleWidth() const override { return visibleRect().width(); } | 192 int visibleWidth() const override { return visibleRect().width(); } |
| 188 IntSize contentsSize() const override; | 193 IntSize contentsSize() const override; |
| 189 bool scrollbarsCanBeActive() const override { return false; } | 194 bool scrollbarsCanBeActive() const override { return false; } |
| 190 IntRect scrollableAreaBoundingBox() const override; | 195 IntRect scrollableAreaBoundingBox() const override; |
| 191 bool userInputScrollable(ScrollbarOrientation) const override { return true;
} | 196 bool userInputScrollable(ScrollbarOrientation) const override { return true;
} |
| 192 bool shouldPlaceVerticalScrollbarOnLeft() const override { return false; } | 197 bool shouldPlaceVerticalScrollbarOnLeft() const override { return false; } |
| 193 bool scrollAnimatorEnabled() const override; | 198 bool scrollAnimatorEnabled() const override; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 std::unique_ptr<WebScrollbarLayer> m_webOverlayScrollbarHorizontal; | 260 std::unique_ptr<WebScrollbarLayer> m_webOverlayScrollbarHorizontal; |
| 256 std::unique_ptr<WebScrollbarLayer> m_webOverlayScrollbarVertical; | 261 std::unique_ptr<WebScrollbarLayer> m_webOverlayScrollbarVertical; |
| 257 | 262 |
| 258 // Offset of the visual viewport from the main frame's origin, in CSS pixels
. | 263 // Offset of the visual viewport from the main frame's origin, in CSS pixels
. |
| 259 FloatPoint m_offset; | 264 FloatPoint m_offset; |
| 260 float m_scale; | 265 float m_scale; |
| 261 IntSize m_size; | 266 IntSize m_size; |
| 262 float m_topControlsAdjustment; | 267 float m_topControlsAdjustment; |
| 263 float m_maxPageScale; | 268 float m_maxPageScale; |
| 264 bool m_trackPinchZoomStatsForPage; | 269 bool m_trackPinchZoomStatsForPage; |
| 270 |
| 271 RefPtr<ScrollAndScaleEmulator> m_scrollAndScaleEmulator; |
| 265 }; | 272 }; |
| 266 | 273 |
| 267 } // namespace blink | 274 } // namespace blink |
| 268 | 275 |
| 269 #endif // VisualViewport_h | 276 #endif // VisualViewport_h |
| OLD | NEW |