Index: ui/views/layout/box_layout.cc |
diff --git a/ui/views/layout/box_layout.cc b/ui/views/layout/box_layout.cc |
index c11479678a998fe492103648b145b3e4911d81d2..1f82f85ed8ae5672de6310dd2b7e4959986e054a 100644 |
--- a/ui/views/layout/box_layout.cc |
+++ b/ui/views/layout/box_layout.cc |
@@ -81,12 +81,12 @@ void BoxLayout::Layout(View* host) { |
} |
} |
-gfx::Size BoxLayout::GetPreferredSize(View* host) { |
+gfx::Size BoxLayout::GetPreferredSize(const View* host) const { |
// Calculate the child views' preferred width. |
int width = 0; |
if (orientation_ == kVertical) { |
for (int i = 0; i < host->child_count(); ++i) { |
- View* child = host->child_at(i); |
+ const View* child = host->child_at(i); |
if (!child->visible()) |
continue; |
@@ -97,13 +97,13 @@ gfx::Size BoxLayout::GetPreferredSize(View* host) { |
return GetPreferredSizeForChildWidth(host, width); |
} |
-int BoxLayout::GetPreferredHeightForWidth(View* host, int width) { |
+int BoxLayout::GetPreferredHeightForWidth(const View* host, int width) const { |
int child_width = width - NonChildSize(host).width(); |
return GetPreferredSizeForChildWidth(host, child_width).height(); |
} |
-gfx::Size BoxLayout::GetPreferredSizeForChildWidth(View* host, |
- int child_area_width) { |
+gfx::Size BoxLayout::GetPreferredSizeForChildWidth(const View* host, |
+ int child_area_width) const { |
gfx::Rect child_area_bounds; |
if (orientation_ == kHorizontal) { |
@@ -112,7 +112,7 @@ gfx::Size BoxLayout::GetPreferredSizeForChildWidth(View* host, |
// TODO(estade): fix this if it ever becomes a problem. |
int position = 0; |
for (int i = 0; i < host->child_count(); ++i) { |
- View* child = host->child_at(i); |
+ const View* child = host->child_at(i); |
if (!child->visible()) |
continue; |
@@ -127,7 +127,7 @@ gfx::Size BoxLayout::GetPreferredSizeForChildWidth(View* host, |
} else { |
int height = 0; |
for (int i = 0; i < host->child_count(); ++i) { |
- View* child = host->child_at(i); |
+ const View* child = host->child_at(i); |
if (!child->visible()) |
continue; |
@@ -147,7 +147,7 @@ gfx::Size BoxLayout::GetPreferredSizeForChildWidth(View* host, |
child_area_bounds.height() + non_child_size.height()); |
} |
-gfx::Size BoxLayout::NonChildSize(View* host) { |
+gfx::Size BoxLayout::NonChildSize(const View* host) const { |
gfx::Insets insets(host->GetInsets()); |
return gfx::Size(insets.width() + inside_border_insets_.width(), |
insets.height() + inside_border_insets_.height()); |