| Index: ui/views/controls/button/image_button.cc
|
| diff --git a/ui/views/controls/button/image_button.cc b/ui/views/controls/button/image_button.cc
|
| index c8cc3f41ae614a61c4d5f5a74ef9e45761e9eba2..abd2fab17ab6a8d1949cfcc2e48aa5418e44fa14 100644
|
| --- a/ui/views/controls/button/image_button.cc
|
| +++ b/ui/views/controls/button/image_button.cc
|
| @@ -98,20 +98,6 @@ void ImageButton::SetMinimumImageSize(const gfx::Size& size) {
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // ImageButton, View overrides:
|
|
|
| -gfx::Size ImageButton::GetPreferredSize() const {
|
| - gfx::Size size(kDefaultWidth, kDefaultHeight);
|
| - if (!images_[STATE_NORMAL].isNull()) {
|
| - size = gfx::Size(images_[STATE_NORMAL].width(),
|
| - images_[STATE_NORMAL].height());
|
| - }
|
| -
|
| - size.SetToMax(minimum_image_size_);
|
| -
|
| - gfx::Insets insets = GetInsets();
|
| - size.Enlarge(insets.width(), insets.height());
|
| - return size;
|
| -}
|
| -
|
| const char* ImageButton::GetClassName() const {
|
| return kViewClassName;
|
| }
|
| @@ -142,6 +128,20 @@ void ImageButton::OnPaint(gfx::Canvas* canvas) {
|
| Painter::PaintFocusPainter(this, canvas, focus_painter());
|
| }
|
|
|
| +gfx::Size ImageButton::CalculatePreferredSize() const {
|
| + gfx::Size size(kDefaultWidth, kDefaultHeight);
|
| + if (!images_[STATE_NORMAL].isNull()) {
|
| + size = gfx::Size(images_[STATE_NORMAL].width(),
|
| + images_[STATE_NORMAL].height());
|
| + }
|
| +
|
| + size.SetToMax(minimum_image_size_);
|
| +
|
| + gfx::Insets insets = GetInsets();
|
| + size.Enlarge(insets.width(), insets.height());
|
| + return size;
|
| +}
|
| +
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // ImageButton, protected:
|
|
|
|
|