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

Side by Side 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 win 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/child/OWNERS » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "athena/wm/window_overview_mode.h" 5 #include "athena/wm/window_overview_mode.h"
6 6
7 #include <complex> 7 #include <complex>
8 #include <vector> 8 #include <vector>
9 9
10 #include "athena/wm/overview_toolbar.h" 10 #include "athena/wm/overview_toolbar.h"
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 RemoveAnimationObserver(); 770 RemoveAnimationObserver();
771 gesture->SetHandled(); 771 gesture->SetHandled();
772 } 772 }
773 dragged_window_ = NULL; 773 dragged_window_ = NULL;
774 } 774 }
775 } 775 }
776 776
777 // ui::CompositorAnimationObserver: 777 // ui::CompositorAnimationObserver:
778 virtual void OnAnimationStep(base::TimeTicks timestamp) override { 778 virtual void OnAnimationStep(base::TimeTicks timestamp) override {
779 CHECK(fling_); 779 CHECK(fling_);
780 if (fling_->start_timestamp() > timestamp) 780 gfx::Vector2dF delta;
781 return; 781 bool fling_active = fling_->ComputeScrollDeltaAtTime(timestamp, &delta);
782 gfx::Vector2dF scroll = fling_->GetScrollAmountAtTime(timestamp); 782
783 if (scroll.IsZero()) { 783 if (!delta.IsZero())
784 DoScroll(delta.y());
785
786 if (!fling_active) {
784 fling_.reset(); 787 fling_.reset();
785 RemoveAnimationObserver(); 788 RemoveAnimationObserver();
786 } else {
787 DoScroll(scroll.y());
788 } 789 }
789 } 790 }
790 791
791 // WindowListProviderObserver: 792 // WindowListProviderObserver:
792 virtual void OnWindowStackingChanged() override { 793 virtual void OnWindowStackingChanged() override {
793 // Recompute the states of all windows. There isn't enough information at 794 // Recompute the states of all windows. There isn't enough information at
794 // this point to do anything more clever. 795 // this point to do anything more clever.
795 ComputeTerminalStatesForAllWindows(); 796 ComputeTerminalStatesForAllWindows();
796 SetInitialWindowStates(); 797 SetInitialWindowStates();
797 } 798 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 aura::Window* container, 858 aura::Window* container,
858 WindowListProvider* window_list_provider, 859 WindowListProvider* window_list_provider,
859 SplitViewController* split_view_controller, 860 SplitViewController* split_view_controller,
860 WindowOverviewModeDelegate* delegate) { 861 WindowOverviewModeDelegate* delegate) {
861 return scoped_ptr<WindowOverviewMode>( 862 return scoped_ptr<WindowOverviewMode>(
862 new WindowOverviewModeImpl(container, window_list_provider, 863 new WindowOverviewModeImpl(container, window_list_provider,
863 split_view_controller, delegate)); 864 split_view_controller, delegate));
864 } 865 }
865 866
866 } // namespace athena 867 } // namespace athena
OLDNEW
« no previous file with comments | « no previous file | content/child/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698