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

Side by Side Diff: cc/input/top_controls_manager.cc

Issue 609663003: cc: Remove use of PassAs() and constructor-casting with scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cc-passas: PassAs-presubmit-warning Created 6 years, 2 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
« no previous file with comments | « cc/debug/unittest_only_benchmark.cc ('k') | cc/layers/content_layer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 SetControlsTopOffset(top_controls_animation_->GetValue(time)); 173 SetControlsTopOffset(top_controls_animation_->GetValue(time));
174 174
175 if (IsAnimationCompleteAtTime(monotonic_time)) 175 if (IsAnimationCompleteAtTime(monotonic_time))
176 ResetAnimations(); 176 ResetAnimations();
177 177
178 gfx::Vector2dF scroll_delta(0.f, client_->ControlsTopOffset() - old_offset); 178 gfx::Vector2dF scroll_delta(0.f, client_->ControlsTopOffset() - old_offset);
179 return scroll_delta; 179 return scroll_delta;
180 } 180 }
181 181
182 void TopControlsManager::ResetAnimations() { 182 void TopControlsManager::ResetAnimations() {
183 if (top_controls_animation_) 183 top_controls_animation_ = nullptr;
184 top_controls_animation_.reset();
185
186 animation_direction_ = NO_ANIMATION; 184 animation_direction_ = NO_ANIMATION;
187 } 185 }
188 186
189 void TopControlsManager::SetupAnimation(AnimationDirection direction) { 187 void TopControlsManager::SetupAnimation(AnimationDirection direction) {
190 DCHECK(direction != NO_ANIMATION); 188 DCHECK(direction != NO_ANIMATION);
191 189
192 if (direction == SHOWING_CONTROLS && client_->ControlsTopOffset() == 0) 190 if (direction == SHOWING_CONTROLS && client_->ControlsTopOffset() == 0)
193 return; 191 return;
194 192
195 if (direction == HIDING_CONTROLS && 193 if (direction == HIDING_CONTROLS &&
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 247
250 if ((animation_direction_ == SHOWING_CONTROLS && new_offset >= 0) || 248 if ((animation_direction_ == SHOWING_CONTROLS && new_offset >= 0) ||
251 (animation_direction_ == HIDING_CONTROLS 249 (animation_direction_ == HIDING_CONTROLS
252 && new_offset <= -top_controls_height_)) { 250 && new_offset <= -top_controls_height_)) {
253 return true; 251 return true;
254 } 252 }
255 return false; 253 return false;
256 } 254 }
257 255
258 } // namespace cc 256 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug/unittest_only_benchmark.cc ('k') | cc/layers/content_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698