| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // more than just scrolling so we can't simply resize it without incurring | 146 // more than just scrolling so we can't simply resize it without incurring |
| 147 // all sorts of side-effects. Until we can seperate out the scrollability | 147 // all sorts of side-effects. Until we can seperate out the scrollability |
| 148 // aspect from FrameView, we use this method to let PinchViewport make the | 148 // aspect from FrameView, we use this method to let PinchViewport make the |
| 149 // necessary adjustments so that we don't incorrectly clamp scroll offsets | 149 // necessary adjustments so that we don't incorrectly clamp scroll offsets |
| 150 // coming from the compositor. crbug.com/422328 | 150 // coming from the compositor. crbug.com/422328 |
| 151 void setTopControlsAdjustment(float); | 151 void setTopControlsAdjustment(float); |
| 152 | 152 |
| 153 // Adjust the viewport's offset so that it remains bounded by the outer | 153 // Adjust the viewport's offset so that it remains bounded by the outer |
| 154 // viepwort. | 154 // viepwort. |
| 155 void clampToBoundaries(); | 155 void clampToBoundaries(); |
| 156 |
| 157 FloatRect viewportToRootFrame(const FloatRect&) const; |
| 158 IntRect viewportToRootFrame(const IntRect&) const; |
| 159 FloatRect rootFrameToViewport(const FloatRect&) const; |
| 160 IntRect rootFrameToViewport(const IntRect&) const; |
| 161 |
| 162 FloatPoint viewportToRootFrame(const FloatPoint&) const; |
| 163 FloatPoint rootFrameToViewport(const FloatPoint&) const; |
| 164 IntPoint viewportToRootFrame(const IntPoint&) const; |
| 165 IntPoint rootFrameToViewport(const IntPoint&) const; |
| 156 private: | 166 private: |
| 157 explicit PinchViewport(FrameHost&); | 167 explicit PinchViewport(FrameHost&); |
| 158 | 168 |
| 159 // ScrollableArea implementation | 169 // ScrollableArea implementation |
| 160 virtual bool shouldUseIntegerScrollOffset() const override; | 170 virtual bool shouldUseIntegerScrollOffset() const override; |
| 161 virtual bool isActive() const override { return false; } | 171 virtual bool isActive() const override { return false; } |
| 162 virtual int scrollSize(ScrollbarOrientation) const override; | 172 virtual int scrollSize(ScrollbarOrientation) const override; |
| 163 virtual bool isScrollCornerVisible() const override { return false; } | 173 virtual bool isScrollCornerVisible() const override { return false; } |
| 164 virtual IntRect scrollCornerRect() const override { return IntRect(); } | 174 virtual IntRect scrollCornerRect() const override { return IntRect(); } |
| 165 virtual IntPoint scrollPosition() const override { return flooredIntPoint(m_
offset); } | 175 virtual IntPoint scrollPosition() const override { return flooredIntPoint(m_
offset); } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 // Offset of the pinch viewport from the main frame's origin, in CSS pixels. | 221 // Offset of the pinch viewport from the main frame's origin, in CSS pixels. |
| 212 FloatPoint m_offset; | 222 FloatPoint m_offset; |
| 213 float m_scale; | 223 float m_scale; |
| 214 IntSize m_size; | 224 IntSize m_size; |
| 215 float m_topControlsAdjustment; | 225 float m_topControlsAdjustment; |
| 216 }; | 226 }; |
| 217 | 227 |
| 218 } // namespace blink | 228 } // namespace blink |
| 219 | 229 |
| 220 #endif // PinchViewport_h | 230 #endif // PinchViewport_h |
| OLD | NEW |