OLD | NEW |
| (Empty) |
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 | |
5 #ifndef UI_VIEWS_WIDGET_DESKTOP_LAYOUT_MANAGER_H_ | |
6 #define UI_VIEWS_WIDGET_DESKTOP_LAYOUT_MANAGER_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/compiler_specific.h" | |
10 #include "ui/aura/layout_manager.h" | |
11 #include "ui/views/views_export.h" | |
12 | |
13 namespace aura { | |
14 class RootWindow; | |
15 class Window; | |
16 } | |
17 | |
18 namespace views { | |
19 | |
20 // A LayoutManager that by default makes the first Window added to a | |
21 // RootWindow the full size, and will be resized as the RootWindow is resized. | |
22 class VIEWS_EXPORT DesktopLayoutManager : public aura::LayoutManager { | |
23 public: | |
24 explicit DesktopLayoutManager(aura::RootWindow* root_window); | |
25 virtual ~DesktopLayoutManager(); | |
26 | |
27 // Overridden from aura::LayoutManager: | |
28 virtual void OnWindowResized() OVERRIDE; | |
29 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; | |
30 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE; | |
31 virtual void OnWindowRemovedFromLayout(aura::Window* child) OVERRIDE; | |
32 virtual void OnChildWindowVisibilityChanged(aura::Window* child, | |
33 bool visible) OVERRIDE; | |
34 virtual void SetChildBounds(aura::Window* child, | |
35 const gfx::Rect& requested_bounds) OVERRIDE; | |
36 | |
37 private: | |
38 // Sets the size of |main_window_| to the internal bounds of |root_window_|. | |
39 void SetMainWindowSize(); | |
40 | |
41 aura::RootWindow* root_window_; | |
42 aura::Window* main_window_; | |
43 | |
44 DISALLOW_COPY_AND_ASSIGN(DesktopLayoutManager); | |
45 }; | |
46 | |
47 } // namespace views | |
48 | |
49 #endif // UI_VIEWS_WIDGET_DESKTOP_LAYOUT_MANAGER_H_ | |
OLD | NEW |