Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ash / wm / maximize_mode / workspace_backdrop_delegate.h
blobe9c495d26c68efb14ec6f56b26b8813d66f15cbf
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"
11 namespace aura {
12 class Window;
15 namespace ui {
16 class Layer;
19 namespace views {
20 class Widget;
23 namespace ash {
25 // A background which gets created for a container |window| and which gets
26 // stacked behind the topmost window (within that container) covering the
27 // entire container.
28 class WorkspaceBackdropDelegate : public aura::WindowObserver,
29 public WorkspaceLayoutManagerDelegate {
30 public:
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;
50 private:
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();
60 // Show the overlay.
61 void Show();
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.
70 bool in_restacking_;
72 DISALLOW_COPY_AND_ASSIGN(WorkspaceBackdropDelegate);
75 } // namespace ash
77 #endif // ASH_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_