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

Unified Diff: chrome/browser/views/page_info_window.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/page_info_window.cc
===================================================================
--- chrome/browser/views/page_info_window.cc (revision 3391)
+++ chrome/browser/views/page_info_window.cc (working copy)
@@ -170,24 +170,22 @@
// (multi-line). We need to know the width of the description label to know
// its height.
int height = 0;
- CSize size;
- title_label_->GetPreferredSize(&size);
- height += size.cy + kVGapTitleToImage;
+ gfx::Size size = title_label_->GetPreferredSize();
+ height += size.height() + kVGapTitleToImage;
- CSize image_size;
- status_image_->GetPreferredSize(&image_size);
+ gfx::Size image_size = status_image_->GetPreferredSize();
int text_height = 0;
if (!head_line_label_->GetText().empty()) {
- head_line_label_->GetPreferredSize(&size);
- text_height = size.cy + kVGapHeadLineToDescription;
+ size = head_line_label_->GetPreferredSize();
+ text_height = size.height() + kVGapHeadLineToDescription;
}
- int description_width = width - image_size.cx - kHGapImageToDescription -
- kHGapToBorder;
+ int description_width =
+ width - image_size.width() - kHGapImageToDescription - kHGapToBorder;
text_height += description_label_->GetHeightForWidth(description_width);
- height += std::max(static_cast<int>(image_size.cy), text_height);
+ height += std::max(image_size.height(), text_height);
return height;
}
@@ -196,24 +194,24 @@
// First, layout the title and separator.
int x = 0;
int y = 0;
- CSize size;
- title_label_->GetPreferredSize(&size);
- title_label_->SetBounds(x, y, size.cx, size.cy);
- x += size.cx + kHGapTitleToSeparator;
+ gfx::Size size = title_label_->GetPreferredSize();
+ title_label_->SetBounds(x, y, size.width(), size.height());
+ x += size.width() + kHGapTitleToSeparator;
separator_->SetBounds(x + kHExtraSeparatorPadding, y,
- width() - x - 2 * kHExtraSeparatorPadding, size.cy);
+ width() - x - 2 * kHExtraSeparatorPadding,
+ size.height());
// Then the image, head-line and description.
x = kHGapToBorder;
y += title_label_->height() + kVGapTitleToImage;
- status_image_->GetPreferredSize(&size);
- status_image_->SetBounds(x, y, size.cx, size.cy);
- x += size.cx + kHGapImageToDescription;
+ size = status_image_->GetPreferredSize();
+ status_image_->SetBounds(x, y, size.width(), size.height());
+ x += size.width() + kHGapImageToDescription;
int w = width() - x;
if (!head_line_label_->GetText().empty()) {
- head_line_label_->GetPreferredSize(&size);
- head_line_label_->SetBounds(x, y, w > 0 ? w : 0, size.cy);
- y += size.cy + kVGapHeadLineToDescription;
+ size = head_line_label_->GetPreferredSize();
+ head_line_label_->SetBounds(x, y, w > 0 ? w : 0, size.height());
+ y += size.height() + kVGapHeadLineToDescription;
} else {
head_line_label_->SetBounds(x, y, 0, 0);
}
@@ -450,14 +448,13 @@
virtual void Layout() {
if (cert_viewer_button_) {
- CSize ps;
- cert_viewer_button_->GetPreferredSize(&ps);
+ gfx::Size ps = cert_viewer_button_->GetPreferredSize();
CRect parent_bounds;
GetParent()->GetLocalBounds(&parent_bounds, false);
- int y_buttons = parent_bounds.bottom - ps.cy - kButtonVEdgeMargin;
- cert_viewer_button_->SetBounds(kPanelHorizMargin, y_buttons, ps.cx,
- ps.cy);
+ int y_buttons = parent_bounds.bottom - ps.height() - kButtonVEdgeMargin;
+ cert_viewer_button_->SetBounds(kPanelHorizMargin, y_buttons, ps.width(),
+ ps.height());
}
View::Layout();
}

Powered by Google App Engine
This is Rietveld 408576698