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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698