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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 float scale() const { return m_scale; } | 107 float scale() const { return m_scale; } |
108 | 108 |
109 void registerLayersWithTreeView(blink::WebLayerTreeView*) const; | 109 void registerLayersWithTreeView(blink::WebLayerTreeView*) const; |
110 void clearLayersForTreeView(blink::WebLayerTreeView*) const; | 110 void clearLayersForTreeView(blink::WebLayerTreeView*) const; |
111 | 111 |
112 // The portion of the unzoomed frame visible in the inner "pinch" viewport, | 112 // The portion of the unzoomed frame visible in the inner "pinch" viewport, |
113 // in partial CSS pixels. Relative to the main frame. | 113 // in partial CSS pixels. Relative to the main frame. |
114 FloatRect visibleRect() const; | 114 FloatRect visibleRect() const; |
115 | 115 |
116 // The viewport rect relative to the document origin, in partial CSS pixels. | 116 // The viewport rect relative to the document origin, in partial CSS pixels. |
| 117 // FIXME: This should be a DoubleRect since scroll offsets are now doubles. |
117 FloatRect visibleRectInDocument() const; | 118 FloatRect visibleRectInDocument() const; |
118 | 119 |
119 // Scroll the main frame and pinch viewport so that the given rect in the | 120 // Scroll the main frame and pinch viewport so that the given rect in the |
120 // top-level document is centered in the viewport. This method will avoid | 121 // top-level document is centered in the viewport. This method will avoid |
121 // scrolling the pinch viewport unless necessary. | 122 // scrolling the pinch viewport unless necessary. |
122 void scrollIntoView(const LayoutRect&); | 123 void scrollIntoView(const LayoutRect&); |
123 | 124 |
124 // Clamp the given point, in document coordinates, to the maximum/minimum | 125 // Clamp the given point, in document coordinates, to the maximum/minimum |
125 // scroll extents of the viewport within the document. | 126 // scroll extents of the viewport within the document. |
126 IntPoint clampDocumentOffsetAtScale(const IntPoint& offset, float scale); | 127 IntPoint clampDocumentOffsetAtScale(const IntPoint& offset, float scale); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 // Offset of the pinch viewport from the main frame's origin, in CSS pixels. | 189 // Offset of the pinch viewport from the main frame's origin, in CSS pixels. |
189 FloatPoint m_offset; | 190 FloatPoint m_offset; |
190 float m_scale; | 191 float m_scale; |
191 IntSize m_size; | 192 IntSize m_size; |
192 float m_topControlsAdjustment; | 193 float m_topControlsAdjustment; |
193 }; | 194 }; |
194 | 195 |
195 } // namespace blink | 196 } // namespace blink |
196 | 197 |
197 #endif // PinchViewport_h | 198 #endif // PinchViewport_h |
OLD | NEW |