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/input/top_controls_manager.h" | 5 #include "cc/input/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 "cc/animation/keyframed_animation_curve.h" | 10 #include "cc/animation/keyframed_animation_curve.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 return scroll_delta; | 169 return scroll_delta; |
170 } | 170 } |
171 | 171 |
172 void TopControlsManager::ResetAnimations() { | 172 void TopControlsManager::ResetAnimations() { |
173 top_controls_animation_ = nullptr; | 173 top_controls_animation_ = nullptr; |
174 animation_direction_ = NO_ANIMATION; | 174 animation_direction_ = NO_ANIMATION; |
175 } | 175 } |
176 | 176 |
177 void TopControlsManager::SetupAnimation(AnimationDirection direction) { | 177 void TopControlsManager::SetupAnimation(AnimationDirection direction) { |
178 DCHECK_NE(NO_ANIMATION, direction); | 178 DCHECK_NE(NO_ANIMATION, direction); |
179 DCHECK_IMPLIES(direction == HIDING_CONTROLS, TopControlsShownRatio() > 0.f); | 179 DCHECK(direction != HIDING_CONTROLS || TopControlsShownRatio() > 0.f); |
180 DCHECK_IMPLIES(direction == SHOWING_CONTROLS, TopControlsShownRatio() < 1.f); | 180 DCHECK(direction != SHOWING_CONTROLS || TopControlsShownRatio() < 1.f); |
181 | 181 |
182 if (top_controls_animation_ && animation_direction_ == direction) | 182 if (top_controls_animation_ && animation_direction_ == direction) |
183 return; | 183 return; |
184 | 184 |
185 if (!TopControlsHeight()) { | 185 if (!TopControlsHeight()) { |
186 client_->SetCurrentTopControlsShownRatio( | 186 client_->SetCurrentTopControlsShownRatio( |
187 direction == HIDING_CONTROLS ? 0.f : 1.f); | 187 direction == HIDING_CONTROLS ? 0.f : 1.f); |
188 return; | 188 return; |
189 } | 189 } |
190 | 190 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 } | 233 } |
234 return false; | 234 return false; |
235 } | 235 } |
236 | 236 |
237 void TopControlsManager::ResetBaseline() { | 237 void TopControlsManager::ResetBaseline() { |
238 accumulated_scroll_delta_ = 0.f; | 238 accumulated_scroll_delta_ = 0.f; |
239 baseline_content_offset_ = ContentTopOffset(); | 239 baseline_content_offset_ = ContentTopOffset(); |
240 } | 240 } |
241 | 241 |
242 } // namespace cc | 242 } // namespace cc |
OLD | NEW |