| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ASH_WM_ROOT_WINDOW_LAYOUT_MANAGER_H_ | 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_LAYOUT_MANAGER_H_ |
| 6 #define ASH_WM_ROOT_WINDOW_LAYOUT_MANAGER_H_ | 6 #define UI_VIEWS_WIDGET_DESKTOP_LAYOUT_MANAGER_H_ |
| 7 | 7 |
| 8 #include "ash/shell_window_ids.h" | |
| 9 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "ui/aura/layout_manager.h" | 10 #include "ui/aura/layout_manager.h" |
| 11 #include "ui/views/views_export.h" |
| 13 | 12 |
| 14 namespace aura { | 13 namespace aura { |
| 14 class RootWindow; |
| 15 class Window; | 15 class Window; |
| 16 } | 16 } |
| 17 namespace gfx { | 17 |
| 18 class Rect; | |
| 19 } | |
| 20 namespace ui { | |
| 21 class Layer; | |
| 22 } | |
| 23 namespace views { | 18 namespace views { |
| 24 class Widget; | |
| 25 } | |
| 26 | 19 |
| 27 namespace ash { | 20 // A LayoutManager that by default makes the first Window added to a |
| 28 namespace internal { | 21 // RootWindow the full size, and will be resized as the RootWindow is resized. |
| 29 | 22 class VIEWS_EXPORT DesktopLayoutManager : public aura::LayoutManager { |
| 30 // A layout manager for the root window. | |
| 31 // Resizes all of its immediate children to fill the bounds of the root window. | |
| 32 class RootWindowLayoutManager : public aura::LayoutManager { | |
| 33 public: | 23 public: |
| 34 explicit RootWindowLayoutManager(aura::Window* owner); | 24 explicit DesktopLayoutManager(aura::RootWindow* root_window); |
| 35 virtual ~RootWindowLayoutManager(); | 25 virtual ~DesktopLayoutManager(); |
| 36 | 26 |
| 37 // Overridden from aura::LayoutManager: | 27 // Overridden from aura::LayoutManager: |
| 38 virtual void OnWindowResized() OVERRIDE; | 28 virtual void OnWindowResized() OVERRIDE; |
| 39 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; | 29 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; |
| 40 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE; | 30 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE; |
| 41 virtual void OnWindowRemovedFromLayout(aura::Window* child) OVERRIDE; | 31 virtual void OnWindowRemovedFromLayout(aura::Window* child) OVERRIDE; |
| 42 virtual void OnChildWindowVisibilityChanged(aura::Window* child, | 32 virtual void OnChildWindowVisibilityChanged(aura::Window* child, |
| 43 bool visible) OVERRIDE; | 33 bool visible) OVERRIDE; |
| 44 virtual void SetChildBounds(aura::Window* child, | 34 virtual void SetChildBounds(aura::Window* child, |
| 45 const gfx::Rect& requested_bounds) OVERRIDE; | 35 const gfx::Rect& requested_bounds) OVERRIDE; |
| 46 | 36 |
| 47 private: | 37 private: |
| 48 aura::Window* owner_; | 38 // Sets the size of |main_window_| to the internal bounds of |root_window_|. |
| 39 void SetMainWindowSize(); |
| 49 | 40 |
| 50 DISALLOW_COPY_AND_ASSIGN(RootWindowLayoutManager); | 41 aura::RootWindow* root_window_; |
| 42 aura::Window* main_window_; |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(DesktopLayoutManager); |
| 51 }; | 45 }; |
| 52 | 46 |
| 53 } // namespace internal | 47 } // namespace views |
| 54 } // namespace ash | |
| 55 | 48 |
| 56 #endif // ASH_WM_ROOT_WINDOW_LAYOUT_MANAGER_H_ | 49 #endif // UI_VIEWS_WIDGET_DESKTOP_LAYOUT_MANAGER_H_ |
| OLD | NEW |