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

Unified Diff: chrome/views/grid_layout.cc

Issue 7344: Convert GetPreferredSize from:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/views/grid_layout.cc
===================================================================
--- chrome/views/grid_layout.cc (revision 3391)
+++ chrome/views/grid_layout.cc (working copy)
@@ -571,21 +571,20 @@
}
void ColumnSet::CalculateSize() {
- CSize pref;
+ gfx::Size pref;
// Reset the preferred and remaining sizes.
for (std::vector<ViewState*>::iterator i = view_states_.begin();
i != view_states_.end(); ++i) {
ViewState* view_state = *i;
- pref.cx = pref.cy = 0;
if (!view_state->pref_width_fixed || !view_state->pref_height_fixed) {
- view_state->view->GetPreferredSize(&pref);
+ pref = view_state->view->GetPreferredSize();
if (!view_state->pref_width_fixed)
- view_state->pref_width = pref.cx;
+ view_state->pref_width = pref.width();
if (!view_state->pref_height_fixed)
- view_state->pref_height = pref.cy;
+ view_state->pref_height = pref.height();
}
- view_state->remaining_width = pref.cx;
- view_state->remaining_height = pref.cy;
+ view_state->remaining_width = pref.width();
+ view_state->remaining_height = pref.height();
}
// Let layout element reset the sizes for us.
@@ -789,9 +788,11 @@
}
}
-void GridLayout::GetPreferredSize(View* host, CSize* out) {
+gfx::Size GridLayout::GetPreferredSize(View* host) {
DCHECK(host_ == host);
- SizeRowsAndColumns(false, 0, 0, out);
+ CSize out;
+ SizeRowsAndColumns(false, 0, 0, &out);
+ return gfx::Size(out.cx, out.cy);
}
int GridLayout::GetPreferredHeightForWidth(View* host, int width) {

Powered by Google App Engine
This is Rietveld 408576698