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.
5 #ifndef ASH_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_
6 #define ASH_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_
8 #include "ash/wm/workspace/workspace_layout_manager_delegate.h"
9 #include "ui/aura/window_observer.h"
25 // A background which gets created for a container |window| and which gets
26 // stacked behind the topmost window (within that container) covering the
28 class WorkspaceBackdropDelegate
: public aura::WindowObserver
,
29 public WorkspaceLayoutManagerDelegate
{
31 explicit WorkspaceBackdropDelegate(aura::Window
* container
);
32 virtual ~WorkspaceBackdropDelegate();
34 // WindowObserver overrides:
35 virtual void OnWindowBoundsChanged(aura::Window
* window
,
36 const gfx::Rect
& old_bounds
,
37 const gfx::Rect
& new_bounds
) OVERRIDE
;
39 // WorkspaceLayoutManagerDelegate overrides:
40 virtual void OnWindowAddedToLayout(aura::Window
* child
) OVERRIDE
;
41 virtual void OnWindowRemovedFromLayout(aura::Window
* child
) OVERRIDE
;
42 virtual void OnChildWindowVisibilityChanged(aura::Window
* child
,
43 bool visible
) OVERRIDE
;
44 virtual void OnWindowStackingChanged(aura::Window
* window
) OVERRIDE
;
45 virtual void OnPostWindowStateTypeChange(
46 wm::WindowState
* window_state
,
47 wm::WindowStateType old_type
) OVERRIDE
;
48 virtual void OnDisplayWorkAreaInsetsChanged() OVERRIDE
;
51 // Restack the backdrop relatively to the other windows in the container.
52 void RestackBackdrop();
54 // Returns the current visible top level window in the container.
55 aura::Window
* GetCurrentTopWindow();
57 // Position & size the background over the container window.
58 void AdjustToContainerBounds();
63 // The background which covers the rest of the screen.
64 views::Widget
* background_
;
66 // The window which is being "maximized".
67 aura::Window
* container_
;
69 // If true, the |RestackOrHideWindow| might recurse.
72 DISALLOW_COPY_AND_ASSIGN(WorkspaceBackdropDelegate
);
77 #endif // ASH_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_