summaryrefslogtreecommitdiffstats
path: root/ash/wm/window_animation_delegate.h
blob: d68f165e680a8052c19cd3e588a004617284e731 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) 2012 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_WM_WINDOW_ANIMATION_DELEGATE_H_
#define ASH_WM_WINDOW_ANIMATION_DELEGATE_H_

#include "ash/ash_export.h"
#include "base/compiler_specific.h"

namespace aura {
class Window;
}

namespace ash {
namespace internal {

// WindowAnimationDelegate is used to determine if a window should be animated.
// It is only queried if kChildWindowVisibilityChangesAnimatedKey is true.
// The delegate of the parent window is queried. If no delegate is installed
// it is treated as though animations are enabled.
class ASH_EXPORT WindowAnimationDelegate {
 public:
  WindowAnimationDelegate() {}

  static void SetDelegate(aura::Window* window,
                          WindowAnimationDelegate* delegate);
  static WindowAnimationDelegate* GetDelegate(aura::Window* window);

  // Returns true if |window| should be animated.
  virtual bool ShouldAnimateWindow(aura::Window* window) = 0;

 protected:
  virtual ~WindowAnimationDelegate() {}
};

}  // namespace internal
}  // namespace ash

#endif  // ASH_WM_WINDOW_ANIMATION_DELEGATE_H_