| Index: chrome/browser/views/location_bar/icon_label_bubble_view.cc
|
| ===================================================================
|
| --- chrome/browser/views/location_bar/icon_label_bubble_view.cc (revision 53894)
|
| +++ chrome/browser/views/location_bar/icon_label_bubble_view.cc (working copy)
|
| @@ -10,14 +10,12 @@
|
| #include "views/controls/image_view.h"
|
| #include "views/controls/label.h"
|
|
|
| -// Amount to offset the image.
|
| -static const int kImageOffset = 1;
|
| +// Amount of padding at the edges of the bubble.
|
| +static const int kBubbleOuterPadding =
|
| + LocationBarView::kEdgeItemPadding - LocationBarView::kBubblePadding;
|
|
|
| -// Amount to offset the label from the image.
|
| -static const int kLabelOffset = 3;
|
| -
|
| // Amount of padding after the label.
|
| -static const int kLabelPadding = 4;
|
| +static const int kLabelPadding = 5;
|
|
|
| IconLabelBubbleView::IconLabelBubbleView(const int background_images[],
|
| int contained_image,
|
| @@ -48,10 +46,7 @@
|
| }
|
|
|
| void IconLabelBubbleView::Paint(gfx::Canvas* canvas) {
|
| - int y_offset = (GetParent()->height() - height()) / 2;
|
| - canvas->TranslateInt(0, y_offset);
|
| background_painter_.Paint(width(), height(), canvas);
|
| - canvas->TranslateInt(0, -y_offset);
|
| }
|
|
|
| gfx::Size IconLabelBubbleView::GetPreferredSize() {
|
| @@ -61,12 +56,12 @@
|
| }
|
|
|
| void IconLabelBubbleView::Layout() {
|
| - image_->SetBounds(kImageOffset, 0, image_->GetPreferredSize().width(),
|
| + image_->SetBounds(kBubbleOuterPadding, 0, image_->GetPreferredSize().width(),
|
| height());
|
| const int label_height = label_->GetPreferredSize().height();
|
| - label_->SetBounds(image_->x() + image_->width() + kLabelOffset,
|
| - (height() - label_height) / 2, width() - GetNonLabelWidth(),
|
| - label_height);
|
| + label_->SetBounds(image_->x() + image_->width() +
|
| + LocationBarView::kItemPadding, (height() - label_height) / 2,
|
| + width() - GetNonLabelWidth(), label_height);
|
| }
|
|
|
| void IconLabelBubbleView::SetElideInMiddle(bool elide_in_middle) {
|
| @@ -78,6 +73,6 @@
|
| }
|
|
|
| int IconLabelBubbleView::GetNonLabelWidth() {
|
| - return kImageOffset + image_->GetPreferredSize().width() + kLabelOffset +
|
| - kLabelPadding;
|
| + return kBubbleOuterPadding + image_->GetPreferredSize().width() +
|
| + LocationBarView::kItemPadding + kBubbleOuterPadding;
|
| }
|
|
|