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.
5 #ifndef ASH_WM_OVERVIEW_SCOPED_WINDOW_COPY_H_
6 #define ASH_WM_OVERVIEW_SCOPED_WINDOW_COPY_H_
8 #include "base/basictypes.h"
20 class CleanupWidgetAfterAnimationObserver
;
22 // ScopedWindowCopy copies a window and will clean up the copied layers after
23 // the class goes out of scope and the last animation has finished.
24 class ScopedWindowCopy
{
26 ScopedWindowCopy(aura::Window
* target_root
, aura::Window
* src_window
);
29 aura::Window
* GetWindow();
32 // A weak pointer to a copy of the source window owned by cleanup_observer_.
33 views::Widget
* widget_
;
35 // A weak pointer to an animation observer which owns itself. When the
36 // ScopedWindowCopy is destroyed The animation observer will clean up the
37 // widget, layer and itself once any pending animations have completed.
38 CleanupWidgetAfterAnimationObserver
* cleanup_observer_
;
40 DISALLOW_COPY_AND_ASSIGN(ScopedWindowCopy
);
45 #endif // ASH_WM_OVERVIEW_SCOPED_WINDOW_COPY_H_