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

Unified Diff: chrome/browser/views/options/content_page_view.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/browser/views/options/content_page_view.cc
===================================================================
--- chrome/browser/views/options/content_page_view.cc (revision 3391)
+++ chrome/browser/views/options/content_page_view.cc (working copy)
@@ -56,7 +56,7 @@
// ChromeViews::View overrides:
virtual void Paint(ChromeCanvas* canvas);
virtual void Layout();
- virtual void GetPreferredSize(CSize* out);
+ virtual gfx::Size GetPreferredSize();
protected:
// ChromeViews::View overrides:
@@ -111,19 +111,17 @@
void FileDisplayArea::Layout() {
icon_bounds_.SetRect(kFileIconHorizontalSpacing, kFileIconVerticalSpacing,
kFileIconSize, kFileIconSize);
- CSize ps;
- text_field_->GetPreferredSize(&ps);
+ gfx::Size ps = text_field_->GetPreferredSize();
text_field_->SetBounds(icon_bounds_.right() + kFileIconTextFieldSpacing,
- (height() - ps.cy) / 2,
+ (height() - ps.height()) / 2,
width() - icon_bounds_.right() -
kFileIconHorizontalSpacing -
- kFileIconTextFieldSpacing, ps.cy);
+ kFileIconTextFieldSpacing, ps.height());
}
-void FileDisplayArea::GetPreferredSize(CSize* out) {
- DCHECK(out);
- out->cx = kFileIconSize + 2 * kFileIconVerticalSpacing;
- out->cy = kFileIconSize + 2 * kFileIconHorizontalSpacing;
+gfx::Size FileDisplayArea::GetPreferredSize() {
+ return gfx::Size(kFileIconSize + 2 * kFileIconVerticalSpacing,
+ kFileIconSize + 2 * kFileIconHorizontalSpacing);
}
void FileDisplayArea::ViewHierarchyChanged(bool is_add,

Powered by Google App Engine
This is Rietveld 408576698