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

Unified Diff: chrome/browser/views/first_run_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/first_run_view.cc
===================================================================
--- chrome/browser/views/first_run_view.cc (revision 3391)
+++ chrome/browser/views/first_run_view.cc (working copy)
@@ -94,11 +94,10 @@
AddChildView(customize_link_);
}
-void FirstRunView::GetPreferredSize(CSize *out) {
- DCHECK(out);
- *out = ChromeViews::Window::GetLocalizedContentsSize(
+gfx::Size FirstRunView::GetPreferredSize() {
+ return gfx::Size(ChromeViews::Window::GetLocalizedContentsSize(
IDS_FIRSTRUN_DIALOG_WIDTH_CHARS,
- IDS_FIRSTRUN_DIALOG_HEIGHT_LINES).ToSIZE();
+ IDS_FIRSTRUN_DIALOG_HEIGHT_LINES));
}
void FirstRunView::Layout() {
@@ -107,21 +106,20 @@
const int kVertSpacing = 8;
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- CSize pref_size;
- welcome_label_->GetPreferredSize(&pref_size);
+ gfx::Size pref_size = welcome_label_->GetPreferredSize();
// Wrap the label text before we overlap the product icon.
int label_width = background_image()->width() -
rb.GetBitmapNamed(IDR_WIZARD_ICON)->width() - kPanelHorizMargin;
welcome_label_->SetBounds(kPanelHorizMargin, kPanelVertMargin,
- label_width, pref_size.cy);
+ label_width, pref_size.height());
AdjustDialogWidth(welcome_label_);
int next_v_space = background_image()->y() +
background_image()->height() + kPanelVertMargin;
- actions_label_->GetPreferredSize(&pref_size);
+ pref_size = actions_label_->GetPreferredSize();
actions_label_->SetBounds(kPanelHorizMargin, next_v_space,
- pref_size.cx, pref_size.cy);
+ pref_size.width(), pref_size.height());
AdjustDialogWidth(actions_label_);
next_v_space = actions_label_->y() +
@@ -145,9 +143,9 @@
actions_shorcuts_->height() +
kUnrelatedControlVerticalSpacing;
- customize_link_->GetPreferredSize(&pref_size);
+ pref_size = customize_link_->GetPreferredSize();
customize_link_->SetBounds(kPanelHorizMargin, next_v_space,
- pref_size.cx, pref_size.cy);
+ pref_size.width(), pref_size.height());
}
void FirstRunView::OpenCustomizeDialog() {

Powered by Google App Engine
This is Rietveld 408576698