Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_LAYOUT_MANAGER_H_ | 5 #ifndef VIEWS_LAYOUT_MANAGER_H_ |
| 6 #define VIEWS_LAYOUT_MANAGER_H_ | 6 #define VIEWS_LAYOUT_MANAGER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "views/view.h" | 9 #include "views/view.h" |
|
sky
2011/01/25 16:19:12
This include should be nuked.
tfarina
2011/01/25 17:25:20
Some files are depending on it. Can I do this in a
| |
| 10 | 10 |
| 11 namespace gfx { | 11 namespace gfx { |
| 12 class Size; | 12 class Size; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace views { | 15 namespace views { |
| 16 | 16 |
| 17 class View; | |
|
sky
2011/01/25 16:19:12
And this left in.
| |
| 18 | |
| 19 ///////////////////////////////////////////////////////////////////////////// | 17 ///////////////////////////////////////////////////////////////////////////// |
| 20 // | 18 // |
| 21 // LayoutManager interface | 19 // LayoutManager interface |
| 22 // | 20 // |
| 23 // The LayoutManager interface provides methods to handle the sizing of | 21 // The LayoutManager interface provides methods to handle the sizing of |
| 24 // the children of a View according to implementation-specific heuristics. | 22 // the children of a View according to implementation-specific heuristics. |
| 25 // | 23 // |
| 26 ///////////////////////////////////////////////////////////////////////////// | 24 ///////////////////////////////////////////////////////////////////////////// |
| 27 class LayoutManager { | 25 class LayoutManager { |
| 28 public: | 26 public: |
| 29 virtual ~LayoutManager() {} | 27 virtual ~LayoutManager(); |
| 30 | 28 |
| 31 // Notification that this LayoutManager has been installed on a particular | 29 // Notification that this LayoutManager has been installed on a particular |
| 32 // host. | 30 // host. |
| 33 virtual void Installed(View* host) {} | 31 virtual void Installed(View* host); |
| 34 | 32 |
| 35 // Notification that this LayoutManager has been uninstalled on a particular | 33 // Notification that this LayoutManager has been uninstalled on a particular |
| 36 // host. | 34 // host. |
| 37 virtual void Uninstalled(View* host) {} | 35 virtual void Uninstalled(View* host); |
| 38 | 36 |
| 39 // Lay out the children of |host| according to implementation-specific | 37 // Lay out the children of |host| according to implementation-specific |
| 40 // heuristics. The graphics used during painting is provided to allow for | 38 // heuristics. The graphics used during painting is provided to allow for |
| 41 // string sizing. | 39 // string sizing. |
| 42 virtual void Layout(View* host) = 0; | 40 virtual void Layout(View* host) = 0; |
| 43 | 41 |
| 44 // Return the preferred size which is the size required to give each | 42 // Return the preferred size which is the size required to give each |
| 45 // children their respective preferred size. | 43 // children their respective preferred size. |
| 46 virtual gfx::Size GetPreferredSize(View* host) = 0; | 44 virtual gfx::Size GetPreferredSize(View* host) = 0; |
| 47 | 45 |
| 48 // Returns the preferred height for the specified width. The default | 46 // Returns the preferred height for the specified width. The default |
| 49 // implementation returns the value from GetPreferredSize. | 47 // implementation returns the value from GetPreferredSize. |
| 50 virtual int GetPreferredHeightForWidth(View* host, int width); | 48 virtual int GetPreferredHeightForWidth(View* host, int width); |
| 51 | 49 |
| 52 // Notification that a view has been added. | 50 // Notification that a view has been added. |
| 53 virtual void ViewAdded(View* host, View* view) {} | 51 virtual void ViewAdded(View* host, View* view); |
| 54 | 52 |
| 55 // Notification that a view has been removed. | 53 // Notification that a view has been removed. |
| 56 virtual void ViewRemoved(View* host, View* view) {} | 54 virtual void ViewRemoved(View* host, View* view); |
| 57 }; | 55 }; |
| 58 | 56 |
| 59 } // namespace views | 57 } // namespace views |
| 60 | 58 |
| 61 #endif // VIEWS_LAYOUT_MANAGER_H_ | 59 #endif // VIEWS_LAYOUT_MANAGER_H_ |
| OLD | NEW |