Chromium Code Reviews| Index: chrome/browser/ui/views/location_bar/content_setting_image_view.cc |
| diff --git a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc |
| index 9ff07a50510ab65bcf0d49f1f5a63b9ea61999c5..54c08f4f9a99d3416ae05f3a0ae50b051643f648 100644 |
| --- a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc |
| +++ b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc |
| @@ -32,7 +32,7 @@ const int kMoveTimeMs = kFullOpenedTimeMs + 2 * kOpenTimeMs; |
| const int kFrameRateHz = 60; |
| // Margins for animated box. |
| const int kTextMarginPixels = 4; |
| -const int kIconLeftMargin = 4; |
| +const int kIconLeftMargin = 2; |
| // The fraction of the animation we'll spend animating the string into view, and |
| @@ -111,8 +111,6 @@ void ContentSettingImageView::Update(TabContents* tab_contents) { |
| text_size_ = ui::ResourceBundle::GetSharedInstance().GetFont( |
| ui::ResourceBundle::MediumFont).GetStringWidth(animated_text_); |
| text_size_ += 2 * kTextMarginPixels + kIconLeftMargin; |
| - if (border()) |
| - border()->GetInsets(&saved_insets_); |
| slide_animator_->Show(); |
| } |
| } |
| @@ -223,10 +221,7 @@ void ContentSettingImageView::OnPaint(gfx::Canvas* canvas) { |
| // starts to disappear. |
| int necessary_left_margin = std::min(kIconLeftMargin, visible_text_size_); |
| views::Border* empty_border = views::Border::CreateEmptyBorder( |
|
Peter Kasting
2012/08/28 23:22:48
Nit: Wrap after = instead
varunjain
2012/08/29 02:59:57
Done.
|
| - saved_insets_.top(), |
| - saved_insets_.left() + necessary_left_margin, |
| - saved_insets_.bottom(), |
| - saved_insets_.right()); |
| + 0, necessary_left_margin, 0, 0); |
| set_border(empty_border); |
| views::ImageView::OnPaint(canvas); |
| @@ -234,7 +229,7 @@ void ContentSettingImageView::OnPaint(gfx::Canvas* canvas) { |
| ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| canvas->DrawStringInt(animated_text_, |
| rb.GetFont(ui::ResourceBundle::MediumFont), SK_ColorBLACK, |
| - GetImageBounds().right() + kTextMarginPixels, y(), |
| + GetImageBounds().right() + kTextMarginPixels, 0, |
|
Peter Kasting
2012/08/28 23:22:48
Nit: Shouldn't leaving this as "y()" still work?
varunjain
2012/08/29 02:59:57
I am not sure if y() is even correct. It give the
Peter Kasting
2012/08/29 21:35:14
I think you're correct, the coordinates used here
|
| width() - GetImageBounds().width(), height(), |
| gfx::Canvas::TEXT_ALIGN_LEFT | gfx::Canvas::TEXT_VALIGN_MIDDLE); |
| } else { |