OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 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_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_ |
| 6 #define ASH_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_ |
| 7 |
| 8 #include "ash/wm/workspace/workspace_layout_manager_delegate.h" |
| 9 #include "ui/aura/window_observer.h" |
| 10 |
| 11 namespace aura { |
| 12 class Window; |
| 13 } |
| 14 |
| 15 namespace ui { |
| 16 class Layer; |
| 17 } |
| 18 |
| 19 namespace views { |
| 20 class Widget; |
| 21 } |
| 22 |
| 23 namespace ash { |
| 24 |
| 25 namespace internal { |
| 26 |
| 27 // A background which gets created for a container |window| and which gets |
| 28 // stacked behind the topmost window (within that container) covering the |
| 29 // entire container. |
| 30 class WorkspaceBackdropDelegate : public aura::WindowObserver, |
| 31 public WorkspaceLayoutManagerDelegate { |
| 32 public: |
| 33 explicit WorkspaceBackdropDelegate(aura::Window* container); |
| 34 virtual ~WorkspaceBackdropDelegate(); |
| 35 |
| 36 // WindowObserver overrides: |
| 37 virtual void OnWindowBoundsChanged(aura::Window* window, |
| 38 const gfx::Rect& old_bounds, |
| 39 const gfx::Rect& new_bounds) OVERRIDE; |
| 40 |
| 41 // WorkspaceLayoutManagerDelegate overrides: |
| 42 virtual void OnWindowAddedToLayout(aura::Window* child); |
| 43 virtual void OnWindowRemovedFromLayout(aura::Window* child); |
| 44 virtual void OnChildWindowVisibilityChanged(aura::Window* child, |
| 45 bool visible); |
| 46 virtual void OnWindowStackingChanged(aura::Window* window); |
| 47 virtual void OnPostWindowStateTypeChange(wm::WindowState* window_state, |
| 48 wm::WindowStateType old_type); |
| 49 |
| 50 private: |
| 51 // Restack the backdrop relatively to the other windows in the container. |
| 52 void RestackBackdrop(); |
| 53 |
| 54 // Returns the current visible top level window in the container. |
| 55 aura::Window* GetCurrentTopWindow(); |
| 56 |
| 57 // Position & size the background over the container window. |
| 58 void AdjustToContainerBounds(); |
| 59 |
| 60 // Show the overlay. |
| 61 void Show(); |
| 62 |
| 63 // The background which covers the rest of the screen. |
| 64 views::Widget* background_; |
| 65 |
| 66 // The window which is being "maximized". |
| 67 aura::Window* container_; |
| 68 |
| 69 // If true, the |RestackOrHideWindow| might recurse. |
| 70 bool in_restacking_; |
| 71 |
| 72 DISALLOW_COPY_AND_ASSIGN(WorkspaceBackdropDelegate); |
| 73 }; |
| 74 |
| 75 } // namespace internal |
| 76 |
| 77 } // namespace ash |
| 78 |
| 79 #endif // ASH_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_ |
OLD | NEW |