| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_COMMON_WM_OVERVIEW_CLEANUP_ANIMATION_OBSERVER_H_ | |
| 6 #define ASH_COMMON_WM_OVERVIEW_CLEANUP_ANIMATION_OBSERVER_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "ash/ash_export.h" | |
| 11 #include "ash/common/wm/overview/window_selector_delegate.h" | |
| 12 #include "base/macros.h" | |
| 13 #include "ui/compositor/layer_animation_observer.h" | |
| 14 | |
| 15 namespace views { | |
| 16 class Widget; | |
| 17 } | |
| 18 | |
| 19 namespace ash { | |
| 20 | |
| 21 // An observer which holds onto the passed widget until the animation is | |
| 22 // complete. | |
| 23 class ASH_EXPORT CleanupAnimationObserver | |
| 24 : public ui::ImplicitAnimationObserver, | |
| 25 public DelayedAnimationObserver { | |
| 26 public: | |
| 27 explicit CleanupAnimationObserver(std::unique_ptr<views::Widget> widget); | |
| 28 ~CleanupAnimationObserver() override; | |
| 29 | |
| 30 // ui::ImplicitAnimationObserver: | |
| 31 // TODO(varkha): Look into all cases when animations are not started such as | |
| 32 // zero-duration animations and ensure that the object lifetime is handled. | |
| 33 void OnImplicitAnimationsCompleted() override; | |
| 34 | |
| 35 // DelayedAnimationObserver: | |
| 36 void SetOwner(WindowSelectorDelegate* owner) override; | |
| 37 void Shutdown() override; | |
| 38 | |
| 39 private: | |
| 40 std::unique_ptr<views::Widget> widget_; | |
| 41 WindowSelectorDelegate* owner_; | |
| 42 | |
| 43 DISALLOW_COPY_AND_ASSIGN(CleanupAnimationObserver); | |
| 44 }; | |
| 45 | |
| 46 } // namespace ash | |
| 47 | |
| 48 #endif // ASH_COMMON_WM_OVERVIEW_CLEANUP_ANIMATION_OBSERVER_H_ | |
| OLD | NEW |