OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "cc/top_controls_manager.h" | 5 #include "cc/top_controls_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 StartAnimationIfNecessary(); | 133 StartAnimationIfNecessary(); |
134 } | 134 } |
135 } | 135 } |
136 | 136 |
137 void TopControlsManager::ResetAnimations() { | 137 void TopControlsManager::ResetAnimations() { |
138 if (top_controls_animation_) | 138 if (top_controls_animation_) |
139 top_controls_animation_.reset(); | 139 top_controls_animation_.reset(); |
140 } | 140 } |
141 | 141 |
142 LayerImpl* TopControlsManager::RootScrollLayer() { | 142 LayerImpl* TopControlsManager::RootScrollLayer() { |
143 return client_->activeTree()->root_scroll_layer(); | 143 return client_->rootScrollLayer(); |
144 } | 144 } |
145 | 145 |
146 float TopControlsManager::RootScrollLayerTotalScrollY() { | 146 float TopControlsManager::RootScrollLayerTotalScrollY() { |
147 LayerImpl* layer = RootScrollLayer(); | 147 LayerImpl* layer = RootScrollLayer(); |
148 if (!layer) | 148 if (!layer) |
149 return 0; | 149 return 0; |
150 gfx::Vector2dF scroll_total = layer->scrollOffset() + layer->scrollDelta(); | 150 gfx::Vector2dF scroll_total = layer->scrollOffset() + layer->scrollDelta(); |
151 return scroll_total.y(); | 151 return scroll_total.y(); |
152 } | 152 } |
153 | 153 |
(...skipping 17 matching lines...) Expand all Loading... |
171 | 171 |
172 if (controls_top_offset_ != 0 | 172 if (controls_top_offset_ != 0 |
173 && controls_top_offset_ != -top_controls_height_) { | 173 && controls_top_offset_ != -top_controls_height_) { |
174 SetupAnimation( | 174 SetupAnimation( |
175 controls_top_offset_ >= -(top_controls_height_ * kShowHideThreshold)); | 175 controls_top_offset_ >= -(top_controls_height_ * kShowHideThreshold)); |
176 client_->setNeedsRedraw(); | 176 client_->setNeedsRedraw(); |
177 } | 177 } |
178 } | 178 } |
179 | 179 |
180 } // namespace cc | 180 } // namespace cc |
OLD | NEW |