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/ash_export.h"
9 #include "ash/wm/workspace/workspace_layout_manager_delegate.h"
10 #include "base/compiler_specific.h"
11 #include "ui/aura/window_observer.h"
27 // A background which gets created for a container |window| and which gets
28 // stacked behind the topmost window (within that container) covering the
30 class ASH_EXPORT WorkspaceBackdropDelegate
31 : public aura::WindowObserver
,
32 public NON_EXPORTED_BASE(WorkspaceLayoutManagerDelegate
) {
34 explicit WorkspaceBackdropDelegate(aura::Window
* container
);
35 ~WorkspaceBackdropDelegate() override
;
37 // WindowObserver overrides:
38 void OnWindowBoundsChanged(aura::Window
* window
,
39 const gfx::Rect
& old_bounds
,
40 const gfx::Rect
& new_bounds
) override
;
42 // WorkspaceLayoutManagerDelegate overrides:
43 void OnWindowAddedToLayout(aura::Window
* child
) override
;
44 void OnWindowRemovedFromLayout(aura::Window
* child
) override
;
45 void OnChildWindowVisibilityChanged(aura::Window
* child
,
46 bool visible
) override
;
47 void OnWindowStackingChanged(aura::Window
* window
) override
;
48 void OnPostWindowStateTypeChange(wm::WindowState
* window_state
,
49 wm::WindowStateType old_type
) override
;
50 void OnDisplayWorkAreaInsetsChanged() override
;
53 // Restack the backdrop relatively to the other windows in the container.
54 void RestackBackdrop();
56 // Returns the current visible top level window in the container.
57 aura::Window
* GetCurrentTopWindow();
59 // Position & size the background over the container window.
60 void AdjustToContainerBounds();
65 // The background which covers the rest of the screen.
66 views::Widget
* background_
;
68 // The window which is being "maximized".
69 aura::Window
* container_
;
71 // If true, the |RestackOrHideWindow| might recurse.
74 DISALLOW_COPY_AND_ASSIGN(WorkspaceBackdropDelegate
);
79 #endif // ASH_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_