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

Unified Diff: athena/wm/window_overview_mode.cc

Issue 634373003: Consolidate content fling implementations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix GN build 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/child/OWNERS » ('j') | ui/events/gesture_curve.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/wm/window_overview_mode.cc
diff --git a/athena/wm/window_overview_mode.cc b/athena/wm/window_overview_mode.cc
index ce6774420e59d5182c58f42ccddeaaa05a59bb99..f8f9ab004f0543181f09a4df777871ac60d094da 100644
--- a/athena/wm/window_overview_mode.cc
+++ b/athena/wm/window_overview_mode.cc
@@ -696,14 +696,15 @@ class WindowOverviewModeImpl : public WindowOverviewMode,
// ui::CompositorAnimationObserver:
virtual void OnAnimationStep(base::TimeTicks timestamp) override {
CHECK(fling_);
- if (fling_->start_timestamp() > timestamp)
- return;
- gfx::Vector2dF scroll = fling_->GetScrollAmountAtTime(timestamp);
- if (scroll.IsZero()) {
+ gfx::Vector2dF delta;
+ bool fling_active = fling_->ComputeScrollDeltaAtTime(timestamp, &delta);
+
+ if (!scroll.IsZero())
+ DoScroll(delta.y());
+
+ if (!fling_active) {
fling_.reset();
RemoveAnimationObserver();
- } else {
- DoScroll(scroll.y());
}
}
« no previous file with comments | « no previous file | content/child/OWNERS » ('j') | ui/events/gesture_curve.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698