OLD | NEW |
| (Empty) |
1 // Copyright 2014 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_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_ | |
6 #define ASH_COMMON_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 #include "ash/ash_export.h" | |
11 #include "ash/common/wm/workspace/workspace_layout_manager_backdrop_delegate.h" | |
12 #include "base/macros.h" | |
13 | |
14 namespace views { | |
15 class Widget; | |
16 } | |
17 | |
18 namespace ash { | |
19 | |
20 class WmWindow; | |
21 | |
22 // A background which gets created for a container |window| and which gets | |
23 // stacked behind the topmost window (within that container) covering the | |
24 // entire container. | |
25 class ASH_EXPORT WorkspaceBackdropDelegate | |
26 : public WorkspaceLayoutManagerBackdropDelegate { | |
27 public: | |
28 explicit WorkspaceBackdropDelegate(WmWindow* container); | |
29 ~WorkspaceBackdropDelegate() override; | |
30 | |
31 // WorkspaceLayoutManagerBackdropDelegate overrides: | |
32 void OnWindowAddedToLayout(WmWindow* child) override; | |
33 void OnWindowRemovedFromLayout(WmWindow* child) override; | |
34 void OnChildWindowVisibilityChanged(WmWindow* child, bool visible) override; | |
35 void OnWindowStackingChanged(WmWindow* window) override; | |
36 void OnPostWindowStateTypeChange(wm::WindowState* window_state, | |
37 wm::WindowStateType old_type) override; | |
38 void OnDisplayWorkAreaInsetsChanged() override; | |
39 | |
40 private: | |
41 class WindowObserverImpl; | |
42 | |
43 // Restack the backdrop relatively to the other windows in the container. | |
44 void RestackBackdrop(); | |
45 | |
46 // Returns the current visible top level window in the container. | |
47 WmWindow* GetCurrentTopWindow(); | |
48 | |
49 // Position & size the background over the container window. | |
50 void AdjustToContainerBounds(); | |
51 | |
52 // Show the overlay. | |
53 void Show(); | |
54 | |
55 std::unique_ptr<WindowObserverImpl> container_observer_; | |
56 | |
57 // The background which covers the rest of the screen. | |
58 views::Widget* background_ = nullptr; | |
59 // WmWindow for |background_|. | |
60 WmWindow* background_window_ = nullptr; | |
61 | |
62 // The window which is being "maximized". | |
63 WmWindow* container_; | |
64 | |
65 // If true, the |RestackOrHideWindow| might recurse. | |
66 bool in_restacking_; | |
67 | |
68 DISALLOW_COPY_AND_ASSIGN(WorkspaceBackdropDelegate); | |
69 }; | |
70 | |
71 } // namespace ash | |
72 | |
73 #endif // ASH_COMMON_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_ | |
OLD | NEW |