summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/first_run_customize_view.cc
diff options
context:
space:
mode:
authorbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-15 18:02:30 +0000
committerbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-15 18:02:30 +0000
commit154f8bcac65142d7ae6733204c15ae52cfa320c6 (patch)
treed7375c1119946c2914ee79ef2c0e8aa195b1fbe9 /chrome/browser/views/first_run_customize_view.cc
parent8144d0cea4e142ff7d7a75c84240a4bb8a7fb3a4 (diff)
downloadchromium_src-154f8bcac65142d7ae6733204c15ae52cfa320c6.zip
chromium_src-154f8bcac65142d7ae6733204c15ae52cfa320c6.tar.gz
chromium_src-154f8bcac65142d7ae6733204c15ae52cfa320c6.tar.bz2
Convert GetPreferredSize from:
void GetPreferredSize(CSize* out); to: gfx::Size GetPreferredSize(); .. and update some other places to use gfx::Size as well. http://crbug.com/2186 Review URL: http://codereview.chromium.org/7344 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3400 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/first_run_customize_view.cc')
-rw-r--r--chrome/browser/views/first_run_customize_view.cc40
1 files changed, 19 insertions, 21 deletions
diff --git a/chrome/browser/views/first_run_customize_view.cc b/chrome/browser/views/first_run_customize_view.cc
index 9c0b0ab..4a89b5b 100644
--- a/chrome/browser/views/first_run_customize_view.cc
+++ b/chrome/browser/views/first_run_customize_view.cc
@@ -83,11 +83,10 @@ void FirstRunCustomizeView::SetupControls() {
quick_shortcut_cbox_->SetIsSelected(true);
}
-void FirstRunCustomizeView::GetPreferredSize(CSize *out) {
- DCHECK(out);
- *out = ChromeViews::Window::GetLocalizedContentsSize(
+gfx::Size FirstRunCustomizeView::GetPreferredSize() {
+ return gfx::Size(ChromeViews::Window::GetLocalizedContentsSize(
IDS_FIRSTRUNCUSTOMIZE_DIALOG_WIDTH_CHARS,
- IDS_FIRSTRUNCUSTOMIZE_DIALOG_HEIGHT_LINES).ToSIZE();
+ IDS_FIRSTRUNCUSTOMIZE_DIALOG_HEIGHT_LINES));
}
void FirstRunCustomizeView::Layout() {
@@ -96,63 +95,62 @@ void FirstRunCustomizeView::Layout() {
const int kVertSpacing = 8;
const int kComboExtraPad = 8;
- CSize canvas;
- GetPreferredSize(&canvas);
+ gfx::Size canvas = GetPreferredSize();
// Welcome label goes in to to the left. It does not go across the
// entire window because the background gets busy on the right.
- CSize pref_size;
- main_label_->GetPreferredSize(&pref_size);
+ gfx::Size pref_size = main_label_->GetPreferredSize();
main_label_->SetBounds(kPanelHorizMargin, kPanelVertMargin,
- canvas.cx - pref_size.cx, pref_size.cy);
+ canvas.width() - pref_size.width(),
+ pref_size.height());
AdjustDialogWidth(main_label_);
int next_v_space = background_image()->y() +
background_image()->height() + kPanelVertMargin;
- import_cbox_->GetPreferredSize(&pref_size);
+ pref_size = import_cbox_->GetPreferredSize();
import_cbox_->SetBounds(kPanelHorizMargin, next_v_space,
- pref_size.cx, pref_size.cy);
+ pref_size.width(), pref_size.height());
import_cbox_->SetIsSelected(true);
int x_offset = import_cbox_->x() +
import_cbox_->width();
- import_from_combo_->GetPreferredSize(&pref_size);
+ pref_size = import_from_combo_->GetPreferredSize();
import_from_combo_->SetBounds(x_offset,
next_v_space +
(import_cbox_->height() -
- pref_size.cy) / 2,
- pref_size.cx + kComboExtraPad,
- pref_size.cy);
+ pref_size.height()) / 2,
+ pref_size.width() + kComboExtraPad,
+ pref_size.height());
AdjustDialogWidth(import_from_combo_);
next_v_space = import_cbox_->y() + import_cbox_->height() +
kUnrelatedControlVerticalSpacing;
- shortcuts_label_->GetPreferredSize(&pref_size);
+ pref_size = shortcuts_label_->GetPreferredSize();
shortcuts_label_->SetBounds(kPanelHorizMargin, next_v_space,
- pref_size.cx, pref_size.cy);
+ pref_size.width(), pref_size.height());
AdjustDialogWidth(shortcuts_label_);
next_v_space += shortcuts_label_->height() +
kRelatedControlVerticalSpacing;
- desktop_shortcut_cbox_->GetPreferredSize(&pref_size);
+ pref_size = desktop_shortcut_cbox_->GetPreferredSize();
desktop_shortcut_cbox_->SetBounds(kPanelHorizMargin, next_v_space,
- pref_size.cx, pref_size.cy);
+ pref_size.width(), pref_size.height());
AdjustDialogWidth(desktop_shortcut_cbox_);
next_v_space += desktop_shortcut_cbox_->height() +
kRelatedControlVerticalSpacing;
- quick_shortcut_cbox_->GetPreferredSize(&pref_size);
+ pref_size = quick_shortcut_cbox_->GetPreferredSize();
quick_shortcut_cbox_->SetBounds(kPanelHorizMargin, next_v_space,
- pref_size.cx, pref_size.cy);
+ pref_size.width(), pref_size.height());
AdjustDialogWidth(quick_shortcut_cbox_);
}