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

Unified Diff: ash/common/wm/overview/cleanup_animation_observer.h

Issue 2141133002: [ash-md] Animates overview shield in and out (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [ash-md] Completes shield opacity animation after overview closes (nits) Created 4 years, 5 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 | « ash/ash.gyp ('k') | ash/common/wm/overview/cleanup_animation_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/overview/cleanup_animation_observer.h
diff --git a/ash/common/wm/overview/cleanup_animation_observer.h b/ash/common/wm/overview/cleanup_animation_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..a3ad4ffd157f8e1adf6c32e64cc7decd1689604d
--- /dev/null
+++ b/ash/common/wm/overview/cleanup_animation_observer.h
@@ -0,0 +1,48 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_COMMON_WM_OVERVIEW_CLEANUP_ANIMATION_OBSERVER_H_
+#define ASH_COMMON_WM_OVERVIEW_CLEANUP_ANIMATION_OBSERVER_H_
+
+#include <memory>
+
+#include "ash/ash_export.h"
+#include "ash/common/wm/overview/window_selector_delegate.h"
+#include "base/macros.h"
+#include "ui/compositor/layer_animation_observer.h"
+
+namespace views {
+class Widget;
+}
+
+namespace ash {
+
+// An observer which holds onto the passed widget until the animation is
+// complete.
+class ASH_EXPORT CleanupAnimationObserver
+ : public ui::ImplicitAnimationObserver,
+ public DelayedAnimationObserver {
+ public:
+ explicit CleanupAnimationObserver(std::unique_ptr<views::Widget> widget);
+ ~CleanupAnimationObserver() override;
+
+ // ui::ImplicitAnimationObserver:
+ // TODO(varkha): Look into all cases when animations are not started such as
+ // zero-duration animations and ensure that the object lifetime is handled.
+ void OnImplicitAnimationsCompleted() override;
+
+ // DelayedAnimationObserver:
+ void SetOwner(WindowSelectorDelegate* owner) override;
+ void Shutdown() override;
+
+ private:
+ std::unique_ptr<views::Widget> widget_;
+ WindowSelectorDelegate* owner_;
+
+ DISALLOW_COPY_AND_ASSIGN(CleanupAnimationObserver);
+};
+
+} // namespace ash
+
+#endif // ASH_COMMON_WM_OVERVIEW_CLEANUP_ANIMATION_OBSERVER_H_
« no previous file with comments | « ash/ash.gyp ('k') | ash/common/wm/overview/cleanup_animation_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698