| Index: chrome/browser/ui/views/location_bar/location_bar_decoration_view.cc
|
| diff --git a/chrome/browser/ui/views/location_bar/location_bar_decoration_view.cc b/chrome/browser/ui/views/location_bar/location_bar_decoration_view.cc
|
| index 8b214e24084ee23279c1f960a4a3ef9e6ccae187..00a91f99972767bf7c6ca33e206505a69291406e 100644
|
| --- a/chrome/browser/ui/views/location_bar/location_bar_decoration_view.cc
|
| +++ b/chrome/browser/ui/views/location_bar/location_bar_decoration_view.cc
|
| @@ -12,7 +12,6 @@
|
| #include "third_party/skia/include/core/SkShader.h"
|
| #include "ui/base/animation/slide_animation.h"
|
| #include "ui/base/animation/tween.h"
|
| -#include "ui/base/resource/resource_bundle.h"
|
| #include "ui/gfx/canvas.h"
|
| #include "ui/gfx/skia_util.h"
|
| #include "ui/views/border.h"
|
| @@ -22,9 +21,8 @@ namespace {
|
| // Animation parameters.
|
| const int kFrameRateHz = 60;
|
| // Margins for animated box (pixels).
|
| -const int kTextMargin = 4;
|
| +const int kTextMargin = 5;
|
| const int kIconLeftMargin = 4;
|
| -
|
| }
|
|
|
| LocationBarDecorationView::LocationBarDecorationView(
|
| @@ -93,6 +91,14 @@ int LocationBarDecorationView::GetBuiltInHorizontalPadding() const {
|
| return GetBuiltInHorizontalPaddingImpl();
|
| }
|
|
|
| +void LocationBarDecorationView::SetFont(const gfx::Font& font) {
|
| + font_ = font;
|
| +}
|
| +
|
| +void LocationBarDecorationView::SetFontColor(SkColor color) {
|
| + font_color_ = color;
|
| +}
|
| +
|
| void LocationBarDecorationView::StartLabelAnimation(string16 animated_text,
|
| int duration_ms) {
|
| if (!slide_animator_.get()) {
|
| @@ -106,8 +112,7 @@ void LocationBarDecorationView::StartLabelAnimation(string16 animated_text,
|
| // Initialize animated string. It will be cleared when animation is
|
| // completed.
|
| animated_text_ = animated_text;
|
| - text_size_ = ui::ResourceBundle::GetSharedInstance().GetFont(
|
| - ui::ResourceBundle::MediumFont).GetStringWidth(animated_text);
|
| + text_size_ = font_.GetStringWidth(animated_text);
|
| text_size_ += 2 * kTextMargin + kIconLeftMargin;
|
| slide_animator_->Show();
|
| }
|
| @@ -171,9 +176,7 @@ void LocationBarDecorationView::OnPaint(gfx::Canvas* canvas) {
|
| views::ImageView::OnPaint(canvas);
|
|
|
| // Paint text to the right of the icon.
|
| - ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
|
| - canvas->DrawStringInt(animated_text_,
|
| - rb.GetFont(ui::ResourceBundle::MediumFont), SK_ColorBLACK,
|
| + canvas->DrawStringInt(animated_text_, font_, font_color_,
|
| GetImageBounds().right() + kTextMargin, 0,
|
| width() - GetImageBounds().width(), height(),
|
| gfx::Canvas::TEXT_ALIGN_LEFT | gfx::Canvas::TEXT_VALIGN_MIDDLE);
|
|
|