Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2599)

Unified Diff: cc/top_controls_manager.cc

Issue 12025031: Find root scroll layer at tree activation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/top_controls_manager.cc
diff --git a/cc/top_controls_manager.cc b/cc/top_controls_manager.cc
index fcd7d8926f6ce7972d5d591baf2fb50469a5a7c4..a539952f47055005908d14fa6b80dcc435de8c5e 100644
--- a/cc/top_controls_manager.cc
+++ b/cc/top_controls_manager.cc
@@ -46,7 +46,7 @@ TopControlsManager::~TopControlsManager() {
}
void TopControlsManager::UpdateDrawPositions() {
- if (!RootScrollLayer())
+ if (!client_->haveRootScrollLayer())
return;
// If the scroll position has changed underneath us (i.e. a javascript
@@ -118,7 +118,7 @@ void TopControlsManager::ScrollEnd() {
}
void TopControlsManager::Animate(base::TimeTicks monotonic_time) {
- if (!top_controls_animation_ || !RootScrollLayer())
+ if (!top_controls_animation_ || !client_->haveRootScrollLayer())
return;
double time = (monotonic_time - base::TimeTicks()).InMillisecondsF();
@@ -139,16 +139,8 @@ void TopControlsManager::ResetAnimations() {
top_controls_animation_.reset();
}
-LayerImpl* TopControlsManager::RootScrollLayer() {
- return client_->activeTree()->root_scroll_layer();
-}
-
float TopControlsManager::RootScrollLayerTotalScrollY() {
- LayerImpl* layer = RootScrollLayer();
- if (!layer)
- return 0;
- gfx::Vector2dF scroll_total = layer->scrollOffset() + layer->scrollDelta();
- return scroll_total.y();
+ return client_->rootScrollLayerTotalScrollY();
}
void TopControlsManager::SetupAnimation(bool show_controls) {

Powered by Google App Engine
This is Rietveld 408576698