| 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 <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 void SetFlexForView(const View* view, int flex); | 91 void SetFlexForView(const View* view, int flex); |
| 92 | 92 |
| 93 // Clears the flex for the given |view|, causing it to use the default | 93 // Clears the flex for the given |view|, causing it to use the default |
| 94 // flex. | 94 // flex. |
| 95 void ClearFlexForView(const View* view); | 95 void ClearFlexForView(const View* view); |
| 96 | 96 |
| 97 // Sets the flex for views to use when none is specified. | 97 // Sets the flex for views to use when none is specified. |
| 98 void SetDefaultFlex(int default_flex); | 98 void SetDefaultFlex(int default_flex); |
| 99 | 99 |
| 100 // Overridden from views::LayoutManager: | 100 // Overridden from views::LayoutManager: |
| 101 virtual void Installed(View* host) OVERRIDE; | 101 virtual void Installed(View* host) override; |
| 102 virtual void Uninstalled(View* host) OVERRIDE; | 102 virtual void Uninstalled(View* host) override; |
| 103 virtual void ViewRemoved(View* host, View* view) OVERRIDE; | 103 virtual void ViewRemoved(View* host, View* view) override; |
| 104 virtual void Layout(View* host) OVERRIDE; | 104 virtual void Layout(View* host) override; |
| 105 virtual gfx::Size GetPreferredSize(const View* host) const OVERRIDE; | 105 virtual gfx::Size GetPreferredSize(const View* host) const override; |
| 106 virtual int GetPreferredHeightForWidth(const View* host, | 106 virtual int GetPreferredHeightForWidth(const View* host, |
| 107 int width) const OVERRIDE; | 107 int width) const override; |
| 108 | 108 |
| 109 private: | 109 private: |
| 110 // Returns the flex for the specified |view|. | 110 // Returns the flex for the specified |view|. |
| 111 int GetFlexForView(const View* view) const; | 111 int GetFlexForView(const View* view) const; |
| 112 | 112 |
| 113 // Returns the size and position along the main axis of |rect|. | 113 // Returns the size and position along the main axis of |rect|. |
| 114 int MainAxisSize(const gfx::Rect& rect) const; | 114 int MainAxisSize(const gfx::Rect& rect) const; |
| 115 int MainAxisPosition(const gfx::Rect& rect) const; | 115 int MainAxisPosition(const gfx::Rect& rect) const; |
| 116 | 116 |
| 117 // Sets the size and position along the main axis of |rect|. | 117 // Sets the size and position along the main axis of |rect|. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 168 |
| 169 // The view that this BoxLayout is managing the layout for. | 169 // The view that this BoxLayout is managing the layout for. |
| 170 views::View* host_; | 170 views::View* host_; |
| 171 | 171 |
| 172 DISALLOW_IMPLICIT_CONSTRUCTORS(BoxLayout); | 172 DISALLOW_IMPLICIT_CONSTRUCTORS(BoxLayout); |
| 173 }; | 173 }; |
| 174 | 174 |
| 175 } // namespace views | 175 } // namespace views |
| 176 | 176 |
| 177 #endif // UI_VIEWS_LAYOUT_BOX_LAYOUT_H_ | 177 #endif // UI_VIEWS_LAYOUT_BOX_LAYOUT_H_ |
| OLD | NEW |