| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "cc/scrollbar_animation_controller.h" | 7 #include "cc/scrollbar_animation_controller.h" |
| 8 | 8 |
| 9 #include "cc/scrollbar_layer_impl.h" | 9 #include "cc/scrollbar_layer_impl.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 if (!scrollLayer->children().size()) | 70 if (!scrollLayer->children().size()) |
| 71 return gfx::Size(); | 71 return gfx::Size(); |
| 72 // Copy & paste from LayerTreeHostImpl... | 72 // Copy & paste from LayerTreeHostImpl... |
| 73 // FIXME: Hardcoding the first child here is weird. Think of | 73 // FIXME: Hardcoding the first child here is weird. Think of |
| 74 // a cleaner way to get the contentBounds on the Impl side. | 74 // a cleaner way to get the contentBounds on the Impl side. |
| 75 return scrollLayer->children()[0]->bounds(); | 75 return scrollLayer->children()[0]->bounds(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void ScrollbarAnimationController::updateScrollOffsetAtTime(LayerImpl* scrollLay
er, double) | 78 void ScrollbarAnimationController::updateScrollOffsetAtTime(LayerImpl* scrollLay
er, double) |
| 79 { | 79 { |
| 80 m_currentPos = scrollLayer->scrollPosition() + scrollLayer->scrollDelta(); | 80 m_currentOffset = scrollLayer->scrollOffset() + scrollLayer->scrollDelta(); |
| 81 m_totalSize = getScrollLayerBounds(scrollLayer); | 81 m_totalSize = getScrollLayerBounds(scrollLayer); |
| 82 m_maximum = scrollLayer->maxScrollPosition(); | 82 m_maximum = scrollLayer->maxScrollOffset(); |
| 83 | 83 |
| 84 if (m_horizontalScrollbarLayer) { | 84 if (m_horizontalScrollbarLayer) { |
| 85 m_horizontalScrollbarLayer->setCurrentPos(m_currentPos.x()); | 85 m_horizontalScrollbarLayer->setCurrentPos(m_currentOffset.x()); |
| 86 m_horizontalScrollbarLayer->setTotalSize(m_totalSize.width()); | 86 m_horizontalScrollbarLayer->setTotalSize(m_totalSize.width()); |
| 87 m_horizontalScrollbarLayer->setMaximum(m_maximum.width()); | 87 m_horizontalScrollbarLayer->setMaximum(m_maximum.x()); |
| 88 } | 88 } |
| 89 | 89 |
| 90 if (m_verticalScrollbarLayer) { | 90 if (m_verticalScrollbarLayer) { |
| 91 m_verticalScrollbarLayer->setCurrentPos(m_currentPos.y()); | 91 m_verticalScrollbarLayer->setCurrentPos(m_currentOffset.y()); |
| 92 m_verticalScrollbarLayer->setTotalSize(m_totalSize.height()); | 92 m_verticalScrollbarLayer->setTotalSize(m_totalSize.height()); |
| 93 m_verticalScrollbarLayer->setMaximum(m_maximum.height()); | 93 m_verticalScrollbarLayer->setMaximum(m_maximum.y()); |
| 94 } | 94 } |
| 95 } | 95 } |
| 96 | 96 |
| 97 } // namespace cc | 97 } // namespace cc |
| OLD | NEW |