1a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved. 2a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 3a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// found in the LICENSE file. 4a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 5a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#ifndef ASH_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_ 6a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#define ASH_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_ 7a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 81320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include "ash/ash_export.h" 9a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#include "ash/wm/workspace/workspace_layout_manager_delegate.h" 101320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include "base/compiler_specific.h" 11a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#include "ui/aura/window_observer.h" 12a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 13a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)namespace aura { 14a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)class Window; 15a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)} 16a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 17a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)namespace ui { 18a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)class Layer; 19a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)} 20a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 21a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)namespace views { 22a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)class Widget; 23a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)} 24a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 25a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)namespace ash { 26a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 27a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// A background which gets created for a container |window| and which gets 28a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// stacked behind the topmost window (within that container) covering the 29a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// entire container. 301320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciclass ASH_EXPORT WorkspaceBackdropDelegate 311320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci : public aura::WindowObserver, 321320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci public NON_EXPORTED_BASE(WorkspaceLayoutManagerDelegate) { 33a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) public: 34a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) explicit WorkspaceBackdropDelegate(aura::Window* container); 35a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) virtual ~WorkspaceBackdropDelegate(); 36a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 37a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // WindowObserver overrides: 38a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) virtual void OnWindowBoundsChanged(aura::Window* window, 39a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) const gfx::Rect& old_bounds, 40a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) const gfx::Rect& new_bounds) OVERRIDE; 41a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 42a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // WorkspaceLayoutManagerDelegate overrides: 43a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; 44a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) virtual void OnWindowRemovedFromLayout(aura::Window* child) OVERRIDE; 45a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) virtual void OnChildWindowVisibilityChanged(aura::Window* child, 46a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) bool visible) OVERRIDE; 47a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) virtual void OnWindowStackingChanged(aura::Window* window) OVERRIDE; 48a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) virtual void OnPostWindowStateTypeChange( 49a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) wm::WindowState* window_state, 50a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) wm::WindowStateType old_type) OVERRIDE; 51f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) virtual void OnDisplayWorkAreaInsetsChanged() OVERRIDE; 52a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 53a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) private: 54a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // Restack the backdrop relatively to the other windows in the container. 55a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) void RestackBackdrop(); 56a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 57a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // Returns the current visible top level window in the container. 58a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) aura::Window* GetCurrentTopWindow(); 59a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 60a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // Position & size the background over the container window. 61a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) void AdjustToContainerBounds(); 62a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 63a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // Show the overlay. 64a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) void Show(); 65a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 66a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // The background which covers the rest of the screen. 67a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) views::Widget* background_; 68a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 69a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // The window which is being "maximized". 70a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) aura::Window* container_; 71a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 72a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // If true, the |RestackOrHideWindow| might recurse. 73a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) bool in_restacking_; 74a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 75a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) DISALLOW_COPY_AND_ASSIGN(WorkspaceBackdropDelegate); 76a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)}; 77a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 78a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)} // namespace ash 79a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 80a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#endif // ASH_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_ 81