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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 FloatRect visibleRectInDocument() const; | 117 FloatRect visibleRectInDocument() const; |
118 | 118 |
119 // Scroll the main frame and pinch viewport so that the given rect in the | 119 // 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 | 120 // top-level document is centered in the viewport. This method will avoid |
121 // scrolling the pinch viewport unless necessary. | 121 // scrolling the pinch viewport unless necessary. |
122 void scrollIntoView(const FloatRect&); | 122 void scrollIntoView(const LayoutRect&); |
123 | 123 |
124 // Clamp the given point, in document coordinates, to the maximum/minimum | 124 // Clamp the given point, in document coordinates, to the maximum/minimum |
125 // scroll extents of the viewport within the document. | 125 // scroll extents of the viewport within the document. |
126 IntPoint clampDocumentOffsetAtScale(const IntPoint& offset, float scale); | 126 IntPoint clampDocumentOffsetAtScale(const IntPoint& offset, float scale); |
127 | 127 |
128 // FIXME: This is kind of a hack. Ideally, we would just resize the | 128 // FIXME: This is kind of a hack. Ideally, we would just resize the |
129 // viewports to account for top controls. However, FrameView includes much | 129 // viewports to account for top controls. However, FrameView includes much |
130 // more than just scrolling so we can't simply resize it without incurring | 130 // more than just scrolling so we can't simply resize it without incurring |
131 // all sorts of side-effects. Until we can seperate out the scrollability | 131 // all sorts of side-effects. Until we can seperate out the scrollability |
132 // aspect from FrameView, we use this method to let PinchViewport make the | 132 // aspect from FrameView, we use this method to let PinchViewport make the |
(...skipping 55 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. | 188 // Offset of the pinch viewport from the main frame's origin, in CSS pixels. |
189 FloatPoint m_offset; | 189 FloatPoint m_offset; |
190 float m_scale; | 190 float m_scale; |
191 IntSize m_size; | 191 IntSize m_size; |
192 float m_topControlsAdjustment; | 192 float m_topControlsAdjustment; |
193 }; | 193 }; |
194 | 194 |
195 } // namespace blink | 195 } // namespace blink |
196 | 196 |
197 #endif // PinchViewport_h | 197 #endif // PinchViewport_h |
OLD | NEW |