| Index: chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
|
| diff --git a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
|
| index 04fd0983e5a4f744d1ddbe6b6421615776873458..e8f58140ec17e2dff76ba8d224f4dc3b8f5946df 100644
|
| --- a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
|
| +++ b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
|
| @@ -12,12 +12,23 @@
|
| #include "ui/views/controls/image_view.h"
|
| #include "ui/views/controls/label.h"
|
|
|
| +namespace {
|
| +
|
| // Amount of padding at the edges of the bubble.
|
| -static const int kBubbleOuterPadding = LocationBarView::kEdgeItemPadding -
|
| - LocationBarView::kBubbleHorizontalPadding;
|
| +//
|
| +// This can't be statically initialized because
|
| +// LocationBarView::GetEdgeItemPadding() depends on whether we are
|
| +// using desktop or touch layout, and this in turn depends on the
|
| +// command line.
|
| +int GetBubbleOuterPadding() {
|
| + return LocationBarView::GetEdgeItemPadding() -
|
| + LocationBarView::kBubbleHorizontalPadding;
|
| +}
|
|
|
| // Amount of padding after the label.
|
| -static const int kLabelPadding = 5;
|
| +const int kLabelPadding = 5;
|
| +
|
| +} // namespace
|
|
|
| IconLabelBubbleView::IconLabelBubbleView(const int background_images[],
|
| int contained_image,
|
| @@ -61,7 +72,7 @@ gfx::Size IconLabelBubbleView::GetPreferredSize() {
|
| }
|
|
|
| void IconLabelBubbleView::Layout() {
|
| - image_->SetBounds(kBubbleOuterPadding +
|
| + image_->SetBounds(GetBubbleOuterPadding() +
|
| (is_extension_icon_ ? LocationBarView::kIconInternalPadding : 0), 0,
|
| image_->GetPreferredSize().width(), height());
|
| const int label_height = label_->GetPreferredSize().height();
|
| @@ -79,10 +90,11 @@ gfx::Size IconLabelBubbleView::GetNonLabelSize() const {
|
|
|
| int IconLabelBubbleView::GetPreLabelWidth() const {
|
| ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
|
| - return kBubbleOuterPadding + rb.GetBitmapNamed(IDR_OMNIBOX_SEARCH)->width() +
|
| - LocationBarView::kItemPadding;
|
| + return GetBubbleOuterPadding() +
|
| + rb.GetBitmapNamed(IDR_OMNIBOX_SEARCH)->width() +
|
| + LocationBarView::GetItemPadding();
|
| }
|
|
|
| int IconLabelBubbleView::GetNonLabelWidth() const {
|
| - return GetPreLabelWidth() + kBubbleOuterPadding;
|
| + return GetPreLabelWidth() + GetBubbleOuterPadding();
|
| }
|
|
|