root_window_layout_manager.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright (c) 2012 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.
  4. #ifndef ASH_WM_ROOT_WINDOW_LAYOUT_MANAGER_H_
  5. #define ASH_WM_ROOT_WINDOW_LAYOUT_MANAGER_H_
  6. #include <vector>
  7. #include "ui/aura/layout_manager.h"
  8. namespace ash {
  9. // A layout manager for the root window.
  10. // Resizes all of its immediate children and their descendants to fill the
  11. // bounds of the associated window.
  12. class RootWindowLayoutManager : public aura::LayoutManager {
  13. public:
  14. explicit RootWindowLayoutManager(aura::Window* owner);
  15. RootWindowLayoutManager(const RootWindowLayoutManager&) = delete;
  16. RootWindowLayoutManager& operator=(const RootWindowLayoutManager&) = delete;
  17. ~RootWindowLayoutManager() override;
  18. // Overridden from aura::LayoutManager:
  19. void OnWindowResized() override;
  20. void OnWindowAddedToLayout(aura::Window* child) override;
  21. void OnWillRemoveWindowFromLayout(aura::Window* child) override;
  22. void OnWindowRemovedFromLayout(aura::Window* child) override;
  23. void OnChildWindowVisibilityChanged(aura::Window* child,
  24. bool visible) override;
  25. void SetChildBounds(aura::Window* child,
  26. const gfx::Rect& requested_bounds) override;
  27. void AddContainer(aura::Window* window);
  28. private:
  29. aura::Window* owner_;
  30. std::vector<aura::Window*> containers_;
  31. };
  32. } // namespace ash
  33. #endif // ASH_WM_ROOT_WINDOW_LAYOUT_MANAGER_H_