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