Size infobar elements to their preferred size at creation time. This allows for
commit898afa22677fc999cd9aeafdde60be43030bacdf
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Mon, 30 Dec 2013 16:59:31 +0000 (30 16:59 +0000)
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Mon, 30 Dec 2013 16:59:31 +0000 (30 16:59 +0000)
tree9a495754204c7c0027df774107ac92ae3a076e9f
parent707d0643faaf2db2c8f1e4fab68eaef60c5d6777
Size infobar elements to their preferred size at creation time.  This allows for
some code simplifications where we can call SetPosition() instead of
SetBounds(), and omit some GetPreferredSize() calls.

Labels and Links still need to use these since their widths actually change;
some simplification for that is coming in a future patch.

This also uses OffsetY() to position the extension infobar contents like all
other infobar objects (instead of dynamically changing the height).

This also makes two other minor changes in passing:
* Don't bother always calling SetFocusable() on Links, that will happen
  automatically.
* Correctly account for icon width when calculating the close button bounds

BUG=none
TEST=Shrinking an infobar to its minimum width should result in less close button overlap with infobar content
R=msw@chromium.org

Review URL: https://codereview.chromium.org/119713002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242725 0039d316-1c4b-4281-b951-d872f2087c98
chrome/browser/ui/views/infobars/after_translate_infobar.cc
chrome/browser/ui/views/infobars/alternate_nav_infobar_view.cc
chrome/browser/ui/views/infobars/before_translate_infobar.cc
chrome/browser/ui/views/infobars/confirm_infobar.cc
chrome/browser/ui/views/infobars/extension_infobar.cc
chrome/browser/ui/views/infobars/infobar_view.cc
chrome/browser/ui/views/infobars/infobar_view.h
chrome/browser/ui/views/infobars/translate_message_infobar.cc