[go: nahoru, domu]

Disable the home launcher animation when tab-dragging starts/ends.

Also disable other windows hide/show animation when tab-dragging process
starts/ends.

Bug: 888173
Change-Id: Iee22d20832cefd61ad7ebdea30b5a65e75b9f204
Reviewed-on: https://chromium-review.googlesource.com/c/1282162
Commit-Queue: Xiaoqian Dai <xdai@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600552}
diff --git a/ash/scoped_animation_disabler.h b/ash/scoped_animation_disabler.h
new file mode 100644
index 0000000..2c07ea3
--- /dev/null
+++ b/ash/scoped_animation_disabler.h
@@ -0,0 +1,33 @@
+// Copyright 2018 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_SCOPED_ANIMATION_DISABLER_H_
+#define ASH_SCOPED_ANIMATION_DISABLER_H_
+
+#include "base/macros.h"
+
+namespace aura {
+class Window;
+}
+
+namespace ash {
+
+// Helper class to perform window state changes without animations. Used to hide
+// /show/minimize windows without having their animation interfere with the ones
+// this class is in charge of.
+class ScopedAnimationDisabler {
+ public:
+  explicit ScopedAnimationDisabler(aura::Window* window);
+  ~ScopedAnimationDisabler();
+
+ private:
+  aura::Window* window_;
+  bool needs_disable_ = false;
+
+  DISALLOW_COPY_AND_ASSIGN(ScopedAnimationDisabler);
+};
+
+}  // namespace ash
+
+#endif  // ASH_SCOPED_ANIMATION_DISABLER_H_