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 UI_VIEWS_LAYOUT_BOX_LAYOUT_H_ | 5 #ifndef UI_VIEWS_LAYOUT_BOX_LAYOUT_H_ |
6 #define UI_VIEWS_LAYOUT_BOX_LAYOUT_H_ | 6 #define UI_VIEWS_LAYOUT_BOX_LAYOUT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "ui/gfx/insets.h" | 10 #include "ui/gfx/insets.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 BoxLayout(Orientation orientation, | 57 BoxLayout(Orientation orientation, |
58 int inside_border_horizontal_spacing, | 58 int inside_border_horizontal_spacing, |
59 int inside_border_vertical_spacing, | 59 int inside_border_vertical_spacing, |
60 int between_child_spacing); | 60 int between_child_spacing); |
61 virtual ~BoxLayout(); | 61 virtual ~BoxLayout(); |
62 | 62 |
63 void set_main_axis_alignment(MainAxisAlignment main_axis_alignment) { | 63 void set_main_axis_alignment(MainAxisAlignment main_axis_alignment) { |
64 main_axis_alignment_ = main_axis_alignment; | 64 main_axis_alignment_ = main_axis_alignment; |
65 } | 65 } |
66 | 66 |
| 67 void set_inside_border_insets(const gfx::Insets& insets) { |
| 68 inside_border_insets_ = insets; |
| 69 } |
| 70 |
67 // Overridden from views::LayoutManager: | 71 // Overridden from views::LayoutManager: |
68 virtual void Layout(View* host) OVERRIDE; | 72 virtual void Layout(View* host) OVERRIDE; |
69 virtual gfx::Size GetPreferredSize(const View* host) const OVERRIDE; | 73 virtual gfx::Size GetPreferredSize(const View* host) const OVERRIDE; |
70 virtual int GetPreferredHeightForWidth(const View* host, | 74 virtual int GetPreferredHeightForWidth(const View* host, |
71 int width) const OVERRIDE; | 75 int width) const OVERRIDE; |
72 | 76 |
73 private: | 77 private: |
74 // Returns the size and position along the main axis of |child_area|. | 78 // Returns the size and position along the main axis of |child_area|. |
75 int MainAxisSize(const gfx::Rect& child_area) const; | 79 int MainAxisSize(const gfx::Rect& child_area) const; |
76 int MainAxisPosition(const gfx::Rect& child_area) const; | 80 int MainAxisPosition(const gfx::Rect& child_area) const; |
(...skipping 21 matching lines...) Expand all Loading... |
98 // The alignment of children in the main axis. This is | 102 // The alignment of children in the main axis. This is |
99 // MAIN_AXIS_ALIGNMENT_START by default. | 103 // MAIN_AXIS_ALIGNMENT_START by default. |
100 MainAxisAlignment main_axis_alignment_; | 104 MainAxisAlignment main_axis_alignment_; |
101 | 105 |
102 DISALLOW_IMPLICIT_CONSTRUCTORS(BoxLayout); | 106 DISALLOW_IMPLICIT_CONSTRUCTORS(BoxLayout); |
103 }; | 107 }; |
104 | 108 |
105 } // namespace views | 109 } // namespace views |
106 | 110 |
107 #endif // UI_VIEWS_LAYOUT_BOX_LAYOUT_H_ | 111 #endif // UI_VIEWS_LAYOUT_BOX_LAYOUT_H_ |
OLD | NEW |