OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 3012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3023 } | 3023 } |
3024 } | 3024 } |
3025 | 3025 |
3026 void FrameView::setTopControlsViewportAdjustment(float adjustment) | 3026 void FrameView::setTopControlsViewportAdjustment(float adjustment) |
3027 { | 3027 { |
3028 m_topControlsViewportAdjustment = adjustment; | 3028 m_topControlsViewportAdjustment = adjustment; |
3029 } | 3029 } |
3030 | 3030 |
3031 IntPoint FrameView::maximumScrollPosition() const | 3031 IntPoint FrameView::maximumScrollPosition() const |
3032 { | 3032 { |
3033 // Make the same calculation as in CC's LayerImpl::MaxScrollOffset() | 3033 FloatSize visibleContentSizeF = unscaledVisibleContentSize(ExcludeScrollbars
); |
3034 // FIXME: We probably shouldn't be storing the bounds in a float. crbug.com/
422331. | 3034 visibleContentSizeF.expand(0, -m_topControlsViewportAdjustment); |
3035 FloatSize visibleSize = unscaledVisibleContentSize(ExcludeScrollbars); | 3035 visibleContentSizeF.scale(1 / visibleContentScaleFactor()); |
3036 visibleSize.expand(0, m_topControlsViewportAdjustment); | 3036 IntSize visibleSize = expandedIntSize(visibleContentSizeF); |
3037 | 3037 |
3038 FloatSize contentBounds = contentsSize(); | 3038 IntPoint maximumOffset( |
3039 contentBounds.scale(visibleContentScaleFactor()); | 3039 contentsWidth() - visibleSize.width() - scrollOrigin().x(), |
3040 contentBounds = flooredIntSize(contentBounds); | 3040 contentsHeight() - visibleSize.height() - scrollOrigin().y()); |
3041 | 3041 maximumOffset.clampNegativeToZero(); |
3042 FloatSize maximumOffset = contentBounds - visibleSize - toIntSize(scrollOrig
in()); | 3042 return maximumOffset; |
3043 | |
3044 // Convert back to CSS pixels. | |
3045 maximumOffset.scale(1 / visibleContentScaleFactor()); | |
3046 | |
3047 IntPoint snappedMaximumOffset = flooredIntPoint(maximumOffset); | |
3048 snappedMaximumOffset.clampNegativeToZero(); | |
3049 return snappedMaximumOffset; | |
3050 } | 3043 } |
3051 | 3044 |
3052 } // namespace blink | 3045 } // namespace blink |
OLD | NEW |