| Index: chrome/views/grid_layout.cc
|
| ===================================================================
|
| --- chrome/views/grid_layout.cc (revision 6997)
|
| +++ chrome/views/grid_layout.cc (working copy)
|
| @@ -763,7 +763,7 @@
|
| DCHECK(host_ == host);
|
| // SizeRowsAndColumns sets the size and location of each row/column, but
|
| // not of the views.
|
| - CSize pref;
|
| + gfx::Size pref;
|
| SizeRowsAndColumns(true, host_->width(), host_->height(), &pref);
|
|
|
| // Size each view.
|
| @@ -790,23 +790,23 @@
|
|
|
| gfx::Size GridLayout::GetPreferredSize(View* host) {
|
| DCHECK(host_ == host);
|
| - CSize out;
|
| + gfx::Size out;
|
| SizeRowsAndColumns(false, 0, 0, &out);
|
| - return gfx::Size(out.cx, out.cy);
|
| + return out;
|
| }
|
|
|
| int GridLayout::GetPreferredHeightForWidth(View* host, int width) {
|
| DCHECK(host_ == host);
|
| - CSize pref;
|
| + gfx::Size pref;
|
| SizeRowsAndColumns(false, width, 0, &pref);
|
| - return pref.cy;
|
| + return pref.height();
|
| }
|
|
|
| void GridLayout::SizeRowsAndColumns(bool layout, int width, int height,
|
| - CSize* pref) {
|
| + gfx::Size* pref) {
|
| // Make sure the master columns have been calculated.
|
| CalculateMasterColumnsIfNecessary();
|
| - pref->cx = pref->cy = 0;
|
| + pref->SetSize(0, 0);
|
| if (rows_.empty())
|
| return;
|
|
|
| @@ -822,9 +822,9 @@
|
| // And reset the x coordinates.
|
| (*i)->ResetColumnXCoordinates();
|
| }
|
| - pref->cx = std::max(static_cast<int>(pref->cx), (*i)->LayoutWidth());
|
| + pref->set_width(std::max(pref->width(), (*i)->LayoutWidth()));
|
| }
|
| - pref->cx += left_inset_ + right_inset_;
|
| + pref->set_width(pref->width() + left_inset_ + right_inset_);
|
|
|
| // Reset the height of each row.
|
| LayoutElement::ResetSizes(&rows_);
|
| @@ -879,13 +879,13 @@
|
| LayoutElement::CalculateLocationsFromSize(&rows_);
|
|
|
| // We now know the preferred height, set it here.
|
| - pref->cy = rows_[rows_.size() - 1]->Location() +
|
| - rows_[rows_.size() - 1]->Size() + top_inset_ + bottom_inset_;
|
| + pref->set_height(rows_[rows_.size() - 1]->Location() +
|
| + rows_[rows_.size() - 1]->Size() + top_inset_ + bottom_inset_);
|
|
|
| - if (layout && height != pref->cy) {
|
| + if (layout && height != pref->height()) {
|
| // We're doing a layout, and the height differs from the preferred height,
|
| // divy up the extra space.
|
| - LayoutElement::DistributeDelta(height - pref->cy, &rows_);
|
| + LayoutElement::DistributeDelta(height - pref->height(), &rows_);
|
|
|
| // Reset y locations.
|
| LayoutElement::CalculateLocationsFromSize(&rows_);
|
|
|