OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_ | 5 #ifndef ASH_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_ |
6 #define ASH_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_ | 6 #define ASH_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/wm/workspace/workspace_layout_manager_delegate.h" | 9 #include "ash/wm/workspace/workspace_layout_manager_delegate.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 namespace ash { | 25 namespace ash { |
26 | 26 |
27 // A background which gets created for a container |window| and which gets | 27 // A background which gets created for a container |window| and which gets |
28 // stacked behind the topmost window (within that container) covering the | 28 // stacked behind the topmost window (within that container) covering the |
29 // entire container. | 29 // entire container. |
30 class ASH_EXPORT WorkspaceBackdropDelegate | 30 class ASH_EXPORT WorkspaceBackdropDelegate |
31 : public aura::WindowObserver, | 31 : public aura::WindowObserver, |
32 public NON_EXPORTED_BASE(WorkspaceLayoutManagerDelegate) { | 32 public NON_EXPORTED_BASE(WorkspaceLayoutManagerDelegate) { |
33 public: | 33 public: |
34 explicit WorkspaceBackdropDelegate(aura::Window* container); | 34 explicit WorkspaceBackdropDelegate(aura::Window* container); |
35 virtual ~WorkspaceBackdropDelegate(); | 35 ~WorkspaceBackdropDelegate() override; |
36 | 36 |
37 // WindowObserver overrides: | 37 // WindowObserver overrides: |
38 virtual void OnWindowBoundsChanged(aura::Window* window, | 38 void OnWindowBoundsChanged(aura::Window* window, |
39 const gfx::Rect& old_bounds, | 39 const gfx::Rect& old_bounds, |
40 const gfx::Rect& new_bounds) override; | 40 const gfx::Rect& new_bounds) override; |
41 | 41 |
42 // WorkspaceLayoutManagerDelegate overrides: | 42 // WorkspaceLayoutManagerDelegate overrides: |
43 virtual void OnWindowAddedToLayout(aura::Window* child) override; | 43 void OnWindowAddedToLayout(aura::Window* child) override; |
44 virtual void OnWindowRemovedFromLayout(aura::Window* child) override; | 44 void OnWindowRemovedFromLayout(aura::Window* child) override; |
45 virtual void OnChildWindowVisibilityChanged(aura::Window* child, | 45 void OnChildWindowVisibilityChanged(aura::Window* child, |
46 bool visible) override; | 46 bool visible) override; |
47 virtual void OnWindowStackingChanged(aura::Window* window) override; | 47 void OnWindowStackingChanged(aura::Window* window) override; |
48 virtual void OnPostWindowStateTypeChange( | 48 void OnPostWindowStateTypeChange(wm::WindowState* window_state, |
49 wm::WindowState* window_state, | 49 wm::WindowStateType old_type) override; |
50 wm::WindowStateType old_type) override; | 50 void OnDisplayWorkAreaInsetsChanged() override; |
51 virtual void OnDisplayWorkAreaInsetsChanged() override; | |
52 | 51 |
53 private: | 52 private: |
54 // Restack the backdrop relatively to the other windows in the container. | 53 // Restack the backdrop relatively to the other windows in the container. |
55 void RestackBackdrop(); | 54 void RestackBackdrop(); |
56 | 55 |
57 // Returns the current visible top level window in the container. | 56 // Returns the current visible top level window in the container. |
58 aura::Window* GetCurrentTopWindow(); | 57 aura::Window* GetCurrentTopWindow(); |
59 | 58 |
60 // Position & size the background over the container window. | 59 // Position & size the background over the container window. |
61 void AdjustToContainerBounds(); | 60 void AdjustToContainerBounds(); |
62 | 61 |
63 // Show the overlay. | 62 // Show the overlay. |
64 void Show(); | 63 void Show(); |
65 | 64 |
66 // The background which covers the rest of the screen. | 65 // The background which covers the rest of the screen. |
67 views::Widget* background_; | 66 views::Widget* background_; |
68 | 67 |
69 // The window which is being "maximized". | 68 // The window which is being "maximized". |
70 aura::Window* container_; | 69 aura::Window* container_; |
71 | 70 |
72 // If true, the |RestackOrHideWindow| might recurse. | 71 // If true, the |RestackOrHideWindow| might recurse. |
73 bool in_restacking_; | 72 bool in_restacking_; |
74 | 73 |
75 DISALLOW_COPY_AND_ASSIGN(WorkspaceBackdropDelegate); | 74 DISALLOW_COPY_AND_ASSIGN(WorkspaceBackdropDelegate); |
76 }; | 75 }; |
77 | 76 |
78 } // namespace ash | 77 } // namespace ash |
79 | 78 |
80 #endif // ASH_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_ | 79 #endif // ASH_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_ |
OLD | NEW |