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/views/combo_box.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/views/combo_box.cc')
-rw-r--r-- | chrome/views/combo_box.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/chrome/views/combo_box.cc b/chrome/views/combo_box.cc index f1010a5..2336ff3 100644 --- a/chrome/views/combo_box.cc +++ b/chrome/views/combo_box.cc @@ -30,10 +30,10 @@ void ComboBox::SetListener(Listener* listener) { listener_ = listener; } -void ComboBox::GetPreferredSize(CSize* out) { +gfx::Size ComboBox::GetPreferredSize() { HWND hwnd = GetNativeControlHWND(); if (!hwnd) - return; + return gfx::Size(); COMBOBOXINFO cbi; memset(reinterpret_cast<unsigned char*>(&cbi), 0, sizeof(cbi)); @@ -54,12 +54,14 @@ void ComboBox::GetPreferredSize(CSize* out) { int item_to_button_distance = std::max(kItemOffset - border.width(), 0); // The cx computation can be read as measuring from left to right. - out->cx = std::max(kItemOffset + content_width_ + kComboboxExtraPaddingX + - item_to_button_distance + rect_button.width() + - border.width(), kMinComboboxWidth); + int pref_width = std::max(kItemOffset + content_width_ + + kComboboxExtraPaddingX + + item_to_button_distance + rect_button.width() + + border.width(), kMinComboboxWidth); // The two arguments to ::max below should be typically be equal. - out->cy = std::max(rect_item.height() + 2 * kItemOffset, - rect_button.height() + 2 * border.height()); + int pref_height = std::max(rect_item.height() + 2 * kItemOffset, + rect_button.height() + 2 * border.height()); + return gfx::Size(pref_width, pref_height); } HWND ComboBox::CreateNativeControl(HWND parent_container) { |