Reland: Add browser_test for extension app API with missing schema
[chromium-blink-merge.git] / ash / wm / maximize_mode / workspace_backdrop_delegate.h
blob27768ac7e370d1433180513951602d1a54677b6f
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;
49 private:
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();
59 // Show the overlay.
60 void Show();
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.
69 bool in_restacking_;
71 DISALLOW_COPY_AND_ASSIGN(WorkspaceBackdropDelegate);
74 } // namespace ash
76 #endif // ASH_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_