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

Side by Side Diff: content/renderer/input/input_handler_proxy.cc

Issue 232683003: Fix for often broken fling scrolls on Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added test Created 6 years, 8 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
« no previous file with comments | « no previous file | content/renderer/input/input_handler_proxy_unittest.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 "content/renderer/input/input_handler_proxy.h" 5 #include "content/renderer/input/input_handler_proxy.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 } 342 }
343 } 343 }
344 return DID_NOT_HANDLE; 344 return DID_NOT_HANDLE;
345 } 345 }
346 346
347 void InputHandlerProxy::Animate(base::TimeTicks time) { 347 void InputHandlerProxy::Animate(base::TimeTicks time) {
348 if (!fling_curve_) 348 if (!fling_curve_)
349 return; 349 return;
350 350
351 double monotonic_time_sec = InSecondsF(time); 351 double monotonic_time_sec = InSecondsF(time);
352 if (!fling_parameters_.startTime) { 352 if (!fling_parameters_.startTime ||
353 monotonic_time_sec <= fling_parameters_.startTime) {
353 fling_parameters_.startTime = monotonic_time_sec; 354 fling_parameters_.startTime = monotonic_time_sec;
354 input_handler_->ScheduleAnimation(); 355 input_handler_->ScheduleAnimation();
355 return; 356 return;
356 } 357 }
357 358
358 bool fling_is_active = 359 bool fling_is_active =
359 fling_curve_->apply(monotonic_time_sec - fling_parameters_.startTime, 360 fling_curve_->apply(monotonic_time_sec - fling_parameters_.startTime,
360 this); 361 this);
361 362
362 if (disallow_vertical_fling_scroll_ && disallow_horizontal_fling_scroll_) 363 if (disallow_vertical_fling_scroll_ && disallow_horizontal_fling_scroll_)
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 510
510 if (did_scroll) { 511 if (did_scroll) {
511 fling_parameters_.cumulativeScroll.width += clipped_increment.width; 512 fling_parameters_.cumulativeScroll.width += clipped_increment.width;
512 fling_parameters_.cumulativeScroll.height += clipped_increment.height; 513 fling_parameters_.cumulativeScroll.height += clipped_increment.height;
513 } 514 }
514 515
515 return did_scroll; 516 return did_scroll;
516 } 517 }
517 518
518 } // namespace content 519 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/input/input_handler_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698