1// Copyright 2013 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 UI_WM_PUBLIC_ANIMATION_HOST_H_
6#define UI_WM_PUBLIC_ANIMATION_HOST_H_
7
8#include "base/compiler_specific.h"
9#include "ui/aura/aura_export.h"
10
11namespace gfx {
12class Vector2d;
13}
14
15namespace aura {
16class Window;
17namespace client {
18
19// Interface for top level window host of animation. Communicates additional
20// bounds required for animation as well as animation completion for deferring
21// window closes on hide.
22class AURA_EXPORT AnimationHost {
23 public:
24  // Ensure the host window is at least this large so that transitions have
25  // sufficient space.
26  // The |top_left_delta| parameter contains the offset to be subtracted from
27  // the window bounds for the top left corner.
28  // The |bottom_right_delta| parameter contains the offset to be added to the
29  // window bounds for the bottom right.
30  virtual void SetHostTransitionOffsets(
31      const gfx::Vector2d& top_left_delta,
32      const gfx::Vector2d& bottom_right_delta) = 0;
33
34  // Called after the window has faded out on a hide.
35  virtual void OnWindowHidingAnimationCompleted() = 0;
36
37 protected:
38  virtual ~AnimationHost() {}
39};
40
41AURA_EXPORT void SetAnimationHost(Window* window,
42                                  AnimationHost* animation_host);
43AURA_EXPORT AnimationHost* GetAnimationHost(Window* window);
44
45}  // namespace client
46}  // namespace aura
47
48#endif  // UI_WM_PUBLIC_ANIMATION_HOST_H_
49