Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: ui/views/layout/box_layout.h

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 28 matching lines...) Expand all
39 int inside_border_vertical_spacing, 39 int inside_border_vertical_spacing,
40 int between_child_spacing); 40 int between_child_spacing);
41 virtual ~BoxLayout(); 41 virtual ~BoxLayout();
42 42
43 void set_spread_blank_space(bool spread) { 43 void set_spread_blank_space(bool spread) {
44 spread_blank_space_ = spread; 44 spread_blank_space_ = spread;
45 } 45 }
46 46
47 // Overridden from views::LayoutManager: 47 // Overridden from views::LayoutManager:
48 virtual void Layout(View* host) OVERRIDE; 48 virtual void Layout(View* host) OVERRIDE;
49 virtual gfx::Size GetPreferredSize(View* host) OVERRIDE; 49 virtual gfx::Size GetPreferredSize(const View* host) const OVERRIDE;
50 virtual int GetPreferredHeightForWidth(View* host, int width) OVERRIDE; 50 virtual int GetPreferredHeightForWidth(const View* host,
51 int width) const OVERRIDE;
51 52
52 private: 53 private:
53 // The preferred size for the dialog given the width of the child area. 54 // The preferred size for the dialog given the width of the child area.
54 gfx::Size GetPreferredSizeForChildWidth(View* host, int child_area_width); 55 gfx::Size GetPreferredSizeForChildWidth(const View* host,
56 int child_area_width) const;
55 57
56 // The amount of space the layout requires in addition to any space for the 58 // The amount of space the layout requires in addition to any space for the
57 // child views. 59 // child views.
58 gfx::Size NonChildSize(View* host); 60 gfx::Size NonChildSize(const View* host) const;
59 61
60 const Orientation orientation_; 62 const Orientation orientation_;
61 63
62 // Spacing between child views and host view border. 64 // Spacing between child views and host view border.
63 gfx::Insets inside_border_insets_; 65 gfx::Insets inside_border_insets_;
64 66
65 // Spacing to put in between child views. 67 // Spacing to put in between child views.
66 const int between_child_spacing_; 68 const int between_child_spacing_;
67 69
68 // Whether the available extra space should be distributed among the child 70 // Whether the available extra space should be distributed among the child
69 // views. 71 // views.
70 bool spread_blank_space_; 72 bool spread_blank_space_;
71 73
72 DISALLOW_IMPLICIT_CONSTRUCTORS(BoxLayout); 74 DISALLOW_IMPLICIT_CONSTRUCTORS(BoxLayout);
73 }; 75 };
74 76
75 } // namespace views 77 } // namespace views
76 78
77 #endif // UI_VIEWS_LAYOUT_BOX_LAYOUT_H_ 79 #endif // UI_VIEWS_LAYOUT_BOX_LAYOUT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698