| Index: ui/views/layout/grid_layout.cc
|
| diff --git a/ui/views/layout/grid_layout.cc b/ui/views/layout/grid_layout.cc
|
| index 4ff22d5471243fb7321a2259b5e94cf46e1ea3dd..135fe19022c7677ba77bcae7900f4df595275cd1 100644
|
| --- a/ui/views/layout/grid_layout.cc
|
| +++ b/ui/views/layout/grid_layout.cc
|
| @@ -820,6 +820,11 @@ int GridLayout::GetPreferredHeightForWidth(const View* host, int width) const {
|
|
|
| void GridLayout::SizeRowsAndColumns(bool layout, int width, int height,
|
| gfx::Size* pref) const {
|
| + // Protect against clients asking for metrics during the addition of a View.
|
| + // The View is in the hierarchy, but it will not be accounted for in the
|
| + // layout calculations at this point, so the result will be incorrect.
|
| + DCHECK(!adding_view_) << "GridLayout queried while adding a view.";
|
| +
|
| // Make sure the master columns have been calculated.
|
| CalculateMasterColumnsIfNecessary();
|
| pref->SetSize(0, 0);
|
|
|