OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 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 ASH_COMMON_WM_WORKSPACE_PHANTOM_WINDOW_CONTROLLER_H_ | |
6 #define ASH_COMMON_WM_WORKSPACE_PHANTOM_WINDOW_CONTROLLER_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 #include "ash/ash_export.h" | |
11 #include "base/macros.h" | |
12 #include "ui/gfx/geometry/rect.h" | |
13 | |
14 namespace views { | |
15 class Widget; | |
16 } | |
17 | |
18 namespace ash { | |
19 | |
20 class WmWindow; | |
21 | |
22 // PhantomWindowController is responsible for showing a phantom representation | |
23 // of a window. It's used to show a preview of how snapping or docking a window | |
24 // will affect the window's bounds. | |
25 class ASH_EXPORT PhantomWindowController { | |
26 public: | |
27 explicit PhantomWindowController(WmWindow* window); | |
28 | |
29 // Hides the phantom window without any animation. | |
30 ~PhantomWindowController(); | |
31 | |
32 // Shows the phantom window and animates shrinking it to |bounds_in_screen|. | |
33 void Show(const gfx::Rect& bounds_in_screen); | |
34 | |
35 private: | |
36 // Creates, shows and returns a phantom widget at |bounds| | |
37 // with kShellWindowId_ShelfContainer in |root_window| as a parent. | |
38 std::unique_ptr<views::Widget> CreatePhantomWidget( | |
39 WmWindow* root_window, | |
40 const gfx::Rect& bounds_in_screen); | |
41 | |
42 // Window that the phantom window is stacked above. | |
43 WmWindow* window_; | |
44 | |
45 // Target bounds (including the shadows if any) of the animation in screen | |
46 // coordinates. | |
47 gfx::Rect target_bounds_in_screen_; | |
48 | |
49 // Phantom representation of the window. | |
50 std::unique_ptr<views::Widget> phantom_widget_; | |
51 | |
52 DISALLOW_COPY_AND_ASSIGN(PhantomWindowController); | |
53 }; | |
54 | |
55 } // namespace ash | |
56 | |
57 #endif // ASH_COMMON_WM_WORKSPACE_PHANTOM_WINDOW_CONTROLLER_H_ | |
OLD | NEW |