| 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 1647164adff4ee34c15ab1f34ea9688652b53676..c6f6c19e553c8e35245b0dbdff6f34cd2901de7a 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
|
| @@ -117,8 +117,9 @@ void IconLabelBubbleView::Layout() {
|
| // the label has zero size it doesn't actually matter what we compute its X
|
| // value to be, since it won't be visible.
|
| const int label_x = image_->bounds().right() + GetInternalSpacing();
|
| - const int label_width = std::max(
|
| - 0, width() - label_x - bubble_trailing_padding - kSpaceBesideSeparator);
|
| + const int label_width =
|
| + std::max(0, width() - label_x - bubble_trailing_padding -
|
| + kSpaceBesideSeparator - GetSeparatorLayoutWidth());
|
| label_->SetBounds(label_x, 0, label_width, height());
|
| }
|
|
|
| @@ -168,14 +169,9 @@ gfx::Size IconLabelBubbleView::GetSizeForLabelWidth(int label_width) const {
|
| // is necessary to animate |total_width| even when the background is hidden
|
| // as long as the animation is still shrinking.
|
| if (ShouldShowLabel() || shrinking) {
|
| - // On scale factors < 2, we reserve 1 DIP for the 1 px separator. For
|
| - // higher scale factors, we simply take the separator px out of the
|
| - // kSpaceBesideSeparator region before the separator, as that results in a
|
| - // width closer to the desired gap than if we added a whole DIP for the
|
| - // separator px. (For scale 2, the two methods have equal error: 1 px.)
|
| - const int separator_width = (GetScaleFactor() >= 2) ? 0 : 1;
|
| const int post_label_width =
|
| - (kSpaceBesideSeparator + separator_width + GetPostSeparatorPadding());
|
| + (kSpaceBesideSeparator + GetSeparatorLayoutWidth() +
|
| + GetPostSeparatorPadding());
|
|
|
| // |multiplier| grows from zero to one, stays equal to one and then shrinks
|
| // to zero again. The view width should correspondingly grow from zero to
|
| @@ -205,6 +201,15 @@ int IconLabelBubbleView::GetPostSeparatorPadding() const {
|
| next_element_interior_padding_;
|
| }
|
|
|
| +int IconLabelBubbleView::GetSeparatorLayoutWidth() const {
|
| + // On scale factors < 2, we reserve 1 DIP for the 1 px separator. For
|
| + // higher scale factors, we simply take the separator px out of the
|
| + // kSpaceBesideSeparator region before the separator, as that results in a
|
| + // width closer to the desired gap than if we added a whole DIP for the
|
| + // separator px. (For scale 2, the two methods have equal error: 1 px.)
|
| + return (GetScaleFactor() >= 2) ? 0 : 1;
|
| +}
|
| +
|
| float IconLabelBubbleView::GetScaleFactor() const {
|
| const views::Widget* widget = GetWidget();
|
| // There may be no widget in tests, and in ash there may be no compositor if
|
|
|