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_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_BACKDROP_H_ |
| 6 #define ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_BACKDROP_H_ |
| 7 |
| 8 #include "ui/aura/window_observer.h" |
| 9 |
| 10 namespace aura { |
| 11 class Window; |
| 12 } |
| 13 |
| 14 namespace ui { |
| 15 class Layer; |
| 16 } |
| 17 |
| 18 namespace views { |
| 19 class Widget; |
| 20 } |
| 21 |
| 22 namespace ash { |
| 23 |
| 24 namespace internal { |
| 25 |
| 26 // A background which gets created for a container |window| and which gets |
| 27 // stacked behind the topmost window (within that container) covering the |
| 28 // entire container. |
| 29 class WorkspaceLayoutManagerBackdrop : public aura::WindowObserver { |
| 30 public: |
| 31 explicit WorkspaceLayoutManagerBackdrop(aura::Window* container); |
| 32 virtual ~WorkspaceLayoutManagerBackdrop(); |
| 33 |
| 34 void RestackOrHideWindow(); |
| 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 private: |
| 42 // Position & size the background over the container window. |
| 43 void AdjustToContainerBounds(); |
| 44 |
| 45 // Show the overlay. |
| 46 void Show(); |
| 47 |
| 48 // The background which covers the rest of the screen. |
| 49 views::Widget* background_; |
| 50 |
| 51 // The window which is being "maximized". |
| 52 aura::Window* container_; |
| 53 |
| 54 // If true, the |RestackOrHideWindow| might recurse. |
| 55 bool inside_; |
| 56 |
| 57 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManagerBackdrop); |
| 58 }; |
| 59 |
| 60 } // namespace internal |
| 61 |
| 62 } // namespace ash |
| 63 |
| 64 #endif // ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_BACKDROP_H_ |
OLD | NEW |