OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |