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
;
50 // Restack the backdrop relatively to the other windows in the container.
51 void RestackBackdrop();
53 // Returns the current visible top level window in the container.
54 aura::Window
* GetCurrentTopWindow();
56 // Position & size the background over the container window.
57 void AdjustToContainerBounds();
62 // The background which covers the rest of the screen.
63 views::Widget
* background_
;
65 // The window which is being "maximized".
66 aura::Window
* container_
;
68 // If true, the |RestackOrHideWindow| might recurse.
71 DISALLOW_COPY_AND_ASSIGN(WorkspaceBackdropDelegate
);
76 #endif // ASH_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_