summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-03 22:16:08 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-03 22:16:08 +0000
commitf9778cc45eac43758e1eeeebd7e21b76ce718ad5 (patch)
tree79e2c4aa9d3e2cd9564e2ad506fc8c597618d89d /cc
parent55c0f96cd37717cec65e5341888a9f7666d2378d (diff)
downloadchromium_src-f9778cc45eac43758e1eeeebd7e21b76ce718ad5.zip
chromium_src-f9778cc45eac43758e1eeeebd7e21b76ce718ad5.tar.gz
chromium_src-f9778cc45eac43758e1eeeebd7e21b76ce718ad5.tar.bz2
cc: Android vertical scrollbars should use linear fade.
When I moved the ifdef for OS_ANDROID to LayerTreeSettings, I only changed the horizontal scrollbar to use the new setting. This updates the vertical scrollbar similarly. BUG=168122 Review URL: https://chromiumcodereview.appspot.com/11746017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175024 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/layer_impl.cc24
1 files changed, 16 insertions, 8 deletions
diff --git a/cc/layer_impl.cc b/cc/layer_impl.cc
index 1f6e21a..dbf3d5e 100644
--- a/cc/layer_impl.cc
+++ b/cc/layer_impl.cc
@@ -789,16 +789,20 @@ const ScrollbarLayerImpl* LayerImpl::horizontalScrollbarLayer() const
return m_scrollbarAnimationController ? m_scrollbarAnimationController->horizontalScrollbarLayer() : 0;
}
+inline scoped_ptr<ScrollbarAnimationController> createScrollbarAnimationControllerWithFade(LayerImpl* layer)
+{
+ double fadeoutDelay = 0.3;
+ double fadeoutLength = 0.3;
+ return ScrollbarAnimationControllerLinearFade::create(layer, fadeoutDelay, fadeoutLength).PassAs<ScrollbarAnimationController>();
+}
+
void LayerImpl::setHorizontalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer)
{
if (!m_scrollbarAnimationController) {
- if (m_layerTreeImpl->settings().useLinearFadeScrollbarAnimator) {
- double fadeoutDelay = 0.3;
- double fadeoutLength = 0.3;
- m_scrollbarAnimationController = ScrollbarAnimationControllerLinearFade::create(this, fadeoutDelay, fadeoutLength).PassAs<ScrollbarAnimationController>();
- } else {
+ if (m_layerTreeImpl->settings().useLinearFadeScrollbarAnimator)
+ m_scrollbarAnimationController = createScrollbarAnimationControllerWithFade(this);
+ else
m_scrollbarAnimationController = ScrollbarAnimationController::create(this);
- }
}
m_scrollbarAnimationController->setHorizontalScrollbarLayer(scrollbarLayer);
m_scrollbarAnimationController->updateScrollOffset(this);
@@ -816,8 +820,12 @@ const ScrollbarLayerImpl* LayerImpl::verticalScrollbarLayer() const
void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer)
{
- if (!m_scrollbarAnimationController)
- m_scrollbarAnimationController = ScrollbarAnimationController::create(this);
+ if (!m_scrollbarAnimationController) {
+ if (m_layerTreeImpl->settings().useLinearFadeScrollbarAnimator)
+ m_scrollbarAnimationController = createScrollbarAnimationControllerWithFade(this);
+ else
+ m_scrollbarAnimationController = ScrollbarAnimationController::create(this);
+ }
m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer);
m_scrollbarAnimationController->updateScrollOffset(this);
}