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

Unified Diff: ui/views/widget/window_visibility_animation_aura.cc

Issue 693523003: MacViews: Put wm window animation calls behind an interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@views-clipboard
Patch Set: Created 6 years, 2 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
Index: ui/views/widget/window_visibility_animation_aura.cc
diff --git a/ui/views/widget/window_visibility_animation_aura.cc b/ui/views/widget/window_visibility_animation_aura.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3171d78001a0b3fe6f23b909373747f60b358541
--- /dev/null
+++ b/ui/views/widget/window_visibility_animation_aura.cc
@@ -0,0 +1,40 @@
+// Copyright 2014 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.
+
+#include "ui/views/widget/window_visibility_animation_aura.h"
+
+#include "ui/wm/core/window_animations.h"
+
+namespace views {
+
+WindowVisibilityAnimationAura::WindowVisibilityAnimationAura(
+ aura::Window* window)
+ : window_(window) {
+ DCHECK(window);
+}
+
+WindowVisibilityAnimationAura::~WindowVisibilityAnimationAura() {
+}
+
+void WindowVisibilityAnimationAura::SetDuration(
+ const base::TimeDelta& duration) {
+ wm::SetWindowVisibilityAnimationDuration(window_, duration);
+}
+
+void WindowVisibilityAnimationAura::SetTransition(Transition transition) {
+ wm::WindowVisibilityAnimationTransition wm_transition;
+ switch (transition) {
+ case ANIMATE_SHOW:
+ wm_transition = wm::ANIMATE_SHOW;
+ case ANIMATE_HIDE:
+ wm_transition = wm::ANIMATE_HIDE;
+ case ANIMATE_BOTH:
+ wm_transition = wm::ANIMATE_BOTH;
+ case ANIMATE_NONE:
+ wm_transition = wm::ANIMATE_NONE;
+ }
+ wm::SetWindowVisibilityAnimationTransition(window_, wm_transition);
+}
+
+} // namespace views
« ui/views/widget/widget.h ('K') | « ui/views/widget/window_visibility_animation_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698