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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // in the viewport. The given and returned rects are in CSS pixels, meaning | 133 // in the viewport. The given and returned rects are in CSS pixels, meaning |
134 // scale isn't applied. | 134 // scale isn't applied. |
135 FloatRect mainViewToViewportCSSPixels(const FloatRect&) const; | 135 FloatRect mainViewToViewportCSSPixels(const FloatRect&) const; |
136 FloatPoint viewportCSSPixelsToRootFrame(const FloatPoint&) const; | 136 FloatPoint viewportCSSPixelsToRootFrame(const FloatPoint&) const; |
137 | 137 |
138 // Clamp the given point, in document coordinates, to the maximum/minimum | 138 // Clamp the given point, in document coordinates, to the maximum/minimum |
139 // scroll extents of the viewport within the document. | 139 // scroll extents of the viewport within the document. |
140 IntPoint clampDocumentOffsetAtScale(const IntPoint& offset, float scale); | 140 IntPoint clampDocumentOffsetAtScale(const IntPoint& offset, float scale); |
141 | 141 |
142 // FIXME: This is kind of a hack. Ideally, we would just resize the | 142 // FIXME: This is kind of a hack. Ideally, we would just resize the |
143 // viewports to account for top controls. However, FrameView includes much | 143 // viewports to account for browser controls. However, FrameView includes much |
144 // more than just scrolling so we can't simply resize it without incurring | 144 // more than just scrolling so we can't simply resize it without incurring |
145 // all sorts of side-effects. Until we can seperate out the scrollability | 145 // all sorts of side-effects. Until we can seperate out the scrollability |
146 // aspect from FrameView, we use this method to let VisualViewport make the | 146 // aspect from FrameView, we use this method to let VisualViewport make the |
147 // necessary adjustments so that we don't incorrectly clamp scroll offsets | 147 // necessary adjustments so that we don't incorrectly clamp scroll offsets |
148 // coming from the compositor. crbug.com/422328 | 148 // coming from the compositor. crbug.com/422328 |
149 void setTopControlsAdjustment(float); | 149 void setBrowserControlsAdjustment(float); |
150 | 150 |
151 // Adjust the viewport's offset so that it remains bounded by the outer | 151 // Adjust the viewport's offset so that it remains bounded by the outer |
152 // viepwort. | 152 // viepwort. |
153 void clampToBoundaries(); | 153 void clampToBoundaries(); |
154 | 154 |
155 FloatRect viewportToRootFrame(const FloatRect&) const; | 155 FloatRect viewportToRootFrame(const FloatRect&) const; |
156 IntRect viewportToRootFrame(const IntRect&) const; | 156 IntRect viewportToRootFrame(const IntRect&) const; |
157 FloatRect rootFrameToViewport(const FloatRect&) const; | 157 FloatRect rootFrameToViewport(const FloatRect&) const; |
158 IntRect rootFrameToViewport(const IntRect&) const; | 158 IntRect rootFrameToViewport(const IntRect&) const; |
159 | 159 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 std::unique_ptr<GraphicsLayer> m_innerViewportScrollLayer; | 257 std::unique_ptr<GraphicsLayer> m_innerViewportScrollLayer; |
258 std::unique_ptr<GraphicsLayer> m_overlayScrollbarHorizontal; | 258 std::unique_ptr<GraphicsLayer> m_overlayScrollbarHorizontal; |
259 std::unique_ptr<GraphicsLayer> m_overlayScrollbarVertical; | 259 std::unique_ptr<GraphicsLayer> m_overlayScrollbarVertical; |
260 std::unique_ptr<WebScrollbarLayer> m_webOverlayScrollbarHorizontal; | 260 std::unique_ptr<WebScrollbarLayer> m_webOverlayScrollbarHorizontal; |
261 std::unique_ptr<WebScrollbarLayer> m_webOverlayScrollbarVertical; | 261 std::unique_ptr<WebScrollbarLayer> m_webOverlayScrollbarVertical; |
262 | 262 |
263 // 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. |
264 ScrollOffset m_offset; | 264 ScrollOffset m_offset; |
265 float m_scale; | 265 float m_scale; |
266 IntSize m_size; | 266 IntSize m_size; |
267 float m_topControlsAdjustment; | 267 float m_browserControlsAdjustment; |
268 float m_maxPageScale; | 268 float m_maxPageScale; |
269 bool m_trackPinchZoomStatsForPage; | 269 bool m_trackPinchZoomStatsForPage; |
270 }; | 270 }; |
271 | 271 |
272 } // namespace blink | 272 } // namespace blink |
273 | 273 |
274 #endif // VisualViewport_h | 274 #endif // VisualViewport_h |
OLD | NEW |