diff options
author | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-15 18:02:30 +0000 |
---|---|---|
committer | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-15 18:02:30 +0000 |
commit | 154f8bcac65142d7ae6733204c15ae52cfa320c6 (patch) | |
tree | d7375c1119946c2914ee79ef2c0e8aa195b1fbe9 /chrome/browser/views/clear_browsing_data.cc | |
parent | 8144d0cea4e142ff7d7a75c84240a4bb8a7fb3a4 (diff) | |
download | chromium_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/clear_browsing_data.cc')
-rw-r--r-- | chrome/browser/views/clear_browsing_data.cc | 61 |
1 files changed, 29 insertions, 32 deletions
diff --git a/chrome/browser/views/clear_browsing_data.cc b/chrome/browser/views/clear_browsing_data.cc index 328cf6f..0bf697d 100644 --- a/chrome/browser/views/clear_browsing_data.cc +++ b/chrome/browser/views/clear_browsing_data.cc @@ -104,101 +104,98 @@ void ClearBrowsingDataView::Init() { //////////////////////////////////////////////////////////////////////////////// // ClearBrowsingDataView, ChromeViews::View implementation: -void ClearBrowsingDataView::GetPreferredSize(CSize *out) { - DCHECK(out); - *out = ChromeViews::Window::GetLocalizedContentsSize( +gfx::Size ClearBrowsingDataView::GetPreferredSize() { + return gfx::Size(ChromeViews::Window::GetLocalizedContentsSize( IDS_CLEARDATA_DIALOG_WIDTH_CHARS, - IDS_CLEARDATA_DIALOG_HEIGHT_LINES).ToSIZE(); + IDS_CLEARDATA_DIALOG_HEIGHT_LINES)); } void ClearBrowsingDataView::Layout() { - CSize panel_size; - GetPreferredSize(&panel_size); - - CSize sz; + gfx::Size panel_size = GetPreferredSize(); // Delete All label goes to the top left corner. - delete_all_label_->GetPreferredSize(&sz); + gfx::Size sz = delete_all_label_->GetPreferredSize(); delete_all_label_->SetBounds(kPanelHorizMargin, kPanelVertMargin, - sz.cx, sz.cy); + sz.width(), sz.height()); // Check-boxes go beneath it (with a little indentation). - del_history_checkbox_->GetPreferredSize(&sz); + sz = del_history_checkbox_->GetPreferredSize(); del_history_checkbox_->SetBounds(2 * kPanelHorizMargin, delete_all_label_->y() + delete_all_label_->height() + kRelatedControlVerticalSpacing, - sz.cx, sz.cy); + sz.width(), sz.height()); - del_downloads_checkbox_->GetPreferredSize(&sz); + sz = del_downloads_checkbox_->GetPreferredSize(); del_downloads_checkbox_->SetBounds(2 * kPanelHorizMargin, del_history_checkbox_->y() + del_history_checkbox_->height() + kRelatedControlVerticalSpacing, - sz.cx, sz.cy); + sz.width(), sz.height()); - del_cache_checkbox_->GetPreferredSize(&sz); + sz = del_cache_checkbox_->GetPreferredSize(); del_cache_checkbox_->SetBounds(2 * kPanelHorizMargin, del_downloads_checkbox_->y() + del_downloads_checkbox_->height() + kRelatedControlVerticalSpacing, - sz.cx, sz.cy); + sz.width(), sz.height()); - del_cookies_checkbox_->GetPreferredSize(&sz); + sz = del_cookies_checkbox_->GetPreferredSize(); del_cookies_checkbox_->SetBounds(2 * kPanelHorizMargin, del_cache_checkbox_->y() + del_cache_checkbox_->height() + kRelatedControlVerticalSpacing, - sz.cx, sz.cy); + sz.width(), sz.height()); - del_passwords_checkbox_->GetPreferredSize(&sz); + sz = del_passwords_checkbox_->GetPreferredSize(); del_passwords_checkbox_->SetBounds(2 * kPanelHorizMargin, del_cookies_checkbox_->y() + del_cookies_checkbox_->height() + kRelatedControlVerticalSpacing, - sz.cx, sz.cy); + sz.width(), sz.height()); // Time period label is next below the combo boxes. - time_period_label_->GetPreferredSize(&sz); + sz = time_period_label_->GetPreferredSize(); time_period_label_->SetBounds(kPanelHorizMargin, del_passwords_checkbox_->y() + del_passwords_checkbox_->height() + kRelatedControlVerticalSpacing + kExtraMarginForTimePeriodLabel, - sz.cx, sz.cy); + sz.width(), sz.height()); // Time period combo box goes on the right of the label, and we align it // vertically to the label as well. - int label_y_size = sz.cy; - time_period_combobox_->GetPreferredSize(&sz); + int label_y_size = sz.height(); + sz = time_period_combobox_->GetPreferredSize(); time_period_combobox_->SetBounds(time_period_label_->x() + time_period_label_->width() + kRelatedControlVerticalSpacing, time_period_label_->y() - - ((sz.cy - label_y_size) / 2), - sz.cx, sz.cy); + ((sz.height() - label_y_size) / 2), + sz.width(), sz.height()); // Get the y-coordinate of our parent so we can position the throbber and // status message at the bottom of the panel. CRect parent_bounds; GetParent()->GetLocalBounds(&parent_bounds, false); - throbber_->GetPreferredSize(&sz); + sz = throbber_->GetPreferredSize(); int throbber_topleft_x = kPanelHorizMargin; - int throbber_topleft_y = parent_bounds.bottom - sz.cy - + int throbber_topleft_y = parent_bounds.bottom - sz.height() - kButtonVEdgeMargin - 3; - throbber_->SetBounds(throbber_topleft_x, throbber_topleft_y, sz.cx, sz.cy); + throbber_->SetBounds(throbber_topleft_x, throbber_topleft_y, sz.width(), + sz.height()); // The status label should be at the bottom of the screen, to the right of // the throbber. - status_label_.GetPreferredSize(&sz); + sz = status_label_.GetPreferredSize(); int status_label_x = throbber_->x() + throbber_->width() + kRelatedControlHorizontalSpacing; status_label_.SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); status_label_.SetBounds(status_label_x, throbber_topleft_y + 1, - sz.cx, - sz.cy); + sz.width(), + sz.height()); } void ClearBrowsingDataView::ViewHierarchyChanged(bool is_add, |