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

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

Issue 130443005: [#5] Pass gfx structs by const ref (gfx::Vector2dF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated the review comments Created 6 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
« no previous file with comments | « cc/input/top_controls_manager.h ('k') | cc/layers/layer.h » ('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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 91 }
92 92
93 void TopControlsManager::ScrollBegin() { 93 void TopControlsManager::ScrollBegin() {
94 DCHECK(!pinch_gesture_active_); 94 DCHECK(!pinch_gesture_active_);
95 ResetAnimations(); 95 ResetAnimations();
96 current_scroll_delta_ = 0.f; 96 current_scroll_delta_ = 0.f;
97 controls_scroll_begin_offset_ = controls_top_offset_; 97 controls_scroll_begin_offset_ = controls_top_offset_;
98 } 98 }
99 99
100 gfx::Vector2dF TopControlsManager::ScrollBy( 100 gfx::Vector2dF TopControlsManager::ScrollBy(
101 const gfx::Vector2dF pending_delta) { 101 const gfx::Vector2dF& pending_delta) {
102 if (pinch_gesture_active_) 102 if (pinch_gesture_active_)
103 return pending_delta; 103 return pending_delta;
104 104
105 if (permitted_state_ == SHOWN && pending_delta.y() > 0) 105 if (permitted_state_ == SHOWN && pending_delta.y() > 0)
106 return pending_delta; 106 return pending_delta;
107 else if (permitted_state_ == HIDDEN && pending_delta.y() < 0) 107 else if (permitted_state_ == HIDDEN && pending_delta.y() < 0)
108 return pending_delta; 108 return pending_delta;
109 109
110 current_scroll_delta_ += pending_delta.y(); 110 current_scroll_delta_ += pending_delta.y();
111 111
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 242
243 if ((animation_direction_ == SHOWING_CONTROLS && new_offset >= 0) || 243 if ((animation_direction_ == SHOWING_CONTROLS && new_offset >= 0) ||
244 (animation_direction_ == HIDING_CONTROLS 244 (animation_direction_ == HIDING_CONTROLS
245 && new_offset <= -top_controls_height_)) { 245 && new_offset <= -top_controls_height_)) {
246 return true; 246 return true;
247 } 247 }
248 return false; 248 return false;
249 } 249 }
250 250
251 } // namespace cc 251 } // namespace cc
OLDNEW
« no previous file with comments | « cc/input/top_controls_manager.h ('k') | cc/layers/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698