Put WeakPtrFactory member last in USBEventRouter
[chromium-blink-merge.git] / ash / wm / overview / scoped_window_copy.h
blobbabc890435f95057dddf67e192f4941071075187
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"
10 namespace aura {
11 class Window;
14 namespace views {
15 class Widget;
18 namespace ash {
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 {
25 public:
26 ScopedWindowCopy(aura::Window* target_root, aura::Window* src_window);
27 ~ScopedWindowCopy();
29 aura::Window* GetWindow();
31 private:
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);
43 } // namespace ash
45 #endif // ASH_WM_OVERVIEW_SCOPED_WINDOW_COPY_H_