blob: d5da4458e929f1aed3917bc72e7af7da7ce482fd (
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
// Copyright 2013 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_OVERVIEW_SCOPED_WINDOW_COPY_H_
#define ASH_WM_OVERVIEW_SCOPED_WINDOW_COPY_H_
#include "base/basictypes.h"
namespace aura {
class RootWindow;
class Window;
}
namespace ui {
class Layer;
}
namespace views {
class Widget;
}
namespace ash {
class CleanupWidgetAfterAnimationObserver;
// ScopedWindowCopy copies a window and will clean up the copied layers after
// the class goes out of scope and the last animation has finished.
class ScopedWindowCopy {
public:
ScopedWindowCopy(aura::Window* target_root, aura::Window* src_window);
~ScopedWindowCopy();
aura::Window* GetWindow();
private:
// A weak pointer to a copy of the source window owned by cleanup_observer_.
views::Widget* widget_;
// A weak pointer to the deep copy of the source window's layers owned by
// cleanup_observer_.
ui::Layer* layer_;
// A weak pointer to an animation observer which owns itself. When the
// ScopedWindowCopy is destroyed The animation observer will clean up the
// widget, layer and itself once any pending animations have completed.
CleanupWidgetAfterAnimationObserver* cleanup_observer_;
DISALLOW_COPY_AND_ASSIGN(ScopedWindowCopy);
};
} // namespace ash
#endif // ASH_WM_OVERVIEW_SCOPED_WINDOW_COPY_H_
|