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

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

Issue 661643004: [android] Remove unused scroll delta in TopControls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adding my name to authors lists 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
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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 gfx::Vector2dF applied_delta(0.f, old_offset - client_->ControlsTopOffset()); 131 gfx::Vector2dF applied_delta(0.f, old_offset - client_->ControlsTopOffset());
132 return pending_delta - applied_delta; 132 return pending_delta - applied_delta;
133 } 133 }
134 134
135 void TopControlsManager::ScrollEnd() { 135 void TopControlsManager::ScrollEnd() {
136 DCHECK(!pinch_gesture_active_); 136 DCHECK(!pinch_gesture_active_);
137 StartAnimationIfNecessary(); 137 StartAnimationIfNecessary();
138 } 138 }
139 139
140 void TopControlsManager::RemoveUnUsedScrollDelta(float unused_delta) {
141 current_scroll_delta_ -= unused_delta;
142 }
143
140 void TopControlsManager::PinchBegin() { 144 void TopControlsManager::PinchBegin() {
141 DCHECK(!pinch_gesture_active_); 145 DCHECK(!pinch_gesture_active_);
142 pinch_gesture_active_ = true; 146 pinch_gesture_active_ = true;
143 StartAnimationIfNecessary(); 147 StartAnimationIfNecessary();
144 } 148 }
145 149
146 void TopControlsManager::PinchEnd() { 150 void TopControlsManager::PinchEnd() {
147 DCHECK(pinch_gesture_active_); 151 DCHECK(pinch_gesture_active_);
148 // Pinch{Begin,End} will always occur within the scope of Scroll{Begin,End}, 152 // Pinch{Begin,End} will always occur within the scope of Scroll{Begin,End},
149 // so return to a state expected by the remaining scroll sequence. 153 // so return to a state expected by the remaining scroll sequence.
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 251
248 if ((animation_direction_ == SHOWING_CONTROLS && new_offset >= 0) || 252 if ((animation_direction_ == SHOWING_CONTROLS && new_offset >= 0) ||
249 (animation_direction_ == HIDING_CONTROLS 253 (animation_direction_ == HIDING_CONTROLS
250 && new_offset <= -top_controls_height_)) { 254 && new_offset <= -top_controls_height_)) {
251 return true; 255 return true;
252 } 256 }
253 return false; 257 return false;
254 } 258 }
255 259
256 } // namespace cc 260 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698