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 <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 RemoveAnimationObserver(); | 689 RemoveAnimationObserver(); |
690 gesture->SetHandled(); | 690 gesture->SetHandled(); |
691 } | 691 } |
692 dragged_window_ = NULL; | 692 dragged_window_ = NULL; |
693 } | 693 } |
694 } | 694 } |
695 | 695 |
696 // ui::CompositorAnimationObserver: | 696 // ui::CompositorAnimationObserver: |
697 virtual void OnAnimationStep(base::TimeTicks timestamp) override { | 697 virtual void OnAnimationStep(base::TimeTicks timestamp) override { |
698 CHECK(fling_); | 698 CHECK(fling_); |
699 if (fling_->start_timestamp() > timestamp) | 699 gfx::Vector2dF delta; |
700 return; | 700 bool fling_active = fling_->ComputeScrollDeltaAtTime(timestamp, &delta); |
701 gfx::Vector2dF scroll = fling_->GetScrollAmountAtTime(timestamp); | 701 |
702 if (scroll.IsZero()) { | 702 if (!scroll.IsZero()) |
| 703 DoScroll(delta.y()); |
| 704 |
| 705 if (!fling_active) { |
703 fling_.reset(); | 706 fling_.reset(); |
704 RemoveAnimationObserver(); | 707 RemoveAnimationObserver(); |
705 } else { | |
706 DoScroll(scroll.y()); | |
707 } | 708 } |
708 } | 709 } |
709 | 710 |
710 // WindowListProviderObserver: | 711 // WindowListProviderObserver: |
711 virtual void OnWindowStackingChanged() override { | 712 virtual void OnWindowStackingChanged() override { |
712 // Recompute the states of all windows. There isn't enough information at | 713 // Recompute the states of all windows. There isn't enough information at |
713 // this point to do anything more clever. | 714 // this point to do anything more clever. |
714 ComputeTerminalStatesForAllWindows(); | 715 ComputeTerminalStatesForAllWindows(); |
715 SetInitialWindowStates(); | 716 SetInitialWindowStates(); |
716 } | 717 } |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 aura::Window* container, | 777 aura::Window* container, |
777 WindowListProvider* window_list_provider, | 778 WindowListProvider* window_list_provider, |
778 SplitViewController* split_view_controller, | 779 SplitViewController* split_view_controller, |
779 WindowOverviewModeDelegate* delegate) { | 780 WindowOverviewModeDelegate* delegate) { |
780 return scoped_ptr<WindowOverviewMode>( | 781 return scoped_ptr<WindowOverviewMode>( |
781 new WindowOverviewModeImpl(container, window_list_provider, | 782 new WindowOverviewModeImpl(container, window_list_provider, |
782 split_view_controller, delegate)); | 783 split_view_controller, delegate)); |
783 } | 784 } |
784 | 785 |
785 } // namespace athena | 786 } // namespace athena |
OLD | NEW |