Chromium Code Reviews| Index: chrome/browser/android/vr_shell/textures/url_bar_texture.cc |
| diff --git a/chrome/browser/android/vr_shell/textures/url_bar_texture.cc b/chrome/browser/android/vr_shell/textures/url_bar_texture.cc |
| index 3c43bf06aca9c987d7b1bc24a3dbee721ffdea18..7a29f3518169be5c25e409b4c1cd3927c0a73ead 100644 |
| --- a/chrome/browser/android/vr_shell/textures/url_bar_texture.cc |
| +++ b/chrome/browser/android/vr_shell/textures/url_bar_texture.cc |
| @@ -84,7 +84,10 @@ gfx::PointF percentToMeters(const gfx::PointF& percent) { |
| } // namespace |
| -UrlBarTexture::UrlBarTexture() : security_level_(SecurityLevel::DANGEROUS) {} |
| +UrlBarTexture::UrlBarTexture( |
| + const base::Callback<void(UiUnsupportedMode)>& failure_callback) |
| + : security_level_(SecurityLevel::DANGEROUS), |
| + failure_callback_(failure_callback) {} |
| UrlBarTexture::~UrlBarTexture() = default; |
| @@ -210,10 +213,12 @@ void UrlBarTexture::Draw(SkCanvas* canvas, const gfx::Size& texture_size) { |
| float url_width = kWidth - url_x - kUrlRightMargin; |
| gfx::Rect text_bounds(ToPixels(url_x), 0, ToPixels(url_width), |
| ToPixels(kHeight)); |
| + base::string16 text = base::UTF8ToUTF16(gurl_.spec()); |
| + if (!CheckFontList(pixel_font_height, text)) |
| + failure_callback_.Run(UiUnsupportedMode::kUnhandledCodePoint); |
| gurl_render_texts_ = PrepareDrawStringRect( |
|
cjgrant
2017/05/26 18:52:00
This needs some non-trivial rebasing, as we don't
Ian Vollick
2017/05/26 20:20:28
Done. Also, since we're now using GetFontList, I w
|
| - base::UTF8ToUTF16(gurl_.spec()), |
| - GetDefaultFontList(pixel_font_height), SK_ColorBLACK, &text_bounds, |
| - kTextAlignmentLeft, kWrappingBehaviorNoWrap); |
| + text, GetDefaultFontList(pixel_font_height), SK_ColorBLACK, |
| + &text_bounds, kTextAlignmentLeft, kWrappingBehaviorNoWrap); |
| last_drawn_gurl_ = gurl_; |
| } |
| for (auto& render_text : gurl_render_texts_) |