OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/favicon/core/fallback_icon_service.h" | 5 #include "components/favicon/core/fallback_icon_service.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 base::string16 icon_text = GetFallbackIconText(icon_url); | 72 base::string16 icon_text = GetFallbackIconText(icon_url); |
73 if (icon_text.empty()) | 73 if (icon_text.empty()) |
74 return; | 74 return; |
75 int font_size = static_cast<int>(size * style.font_size_ratio); | 75 int font_size = static_cast<int>(size * style.font_size_ratio); |
76 if (font_size <= 0) | 76 if (font_size <= 0) |
77 return; | 77 return; |
78 | 78 |
79 canvas->DrawStringRectWithFlags( | 79 canvas->DrawStringRectWithFlags( |
80 icon_text, | 80 icon_text, |
81 gfx::FontList(fallback_icon_client_->GetFontNameList(), gfx::Font::NORMAL, | 81 gfx::FontList(fallback_icon_client_->GetFontNameList(), gfx::Font::NORMAL, |
82 font_size), | 82 font_size, gfx::Font::Weight::NORMAL), |
83 style.text_color, | 83 style.text_color, gfx::Rect(kOffsetX, kOffsetY, size, size), |
84 gfx::Rect(kOffsetX, kOffsetY, size, size), | |
85 gfx::Canvas::TEXT_ALIGN_CENTER); | 84 gfx::Canvas::TEXT_ALIGN_CENTER); |
86 } | 85 } |
87 | 86 |
88 } // namespace favicon | 87 } // namespace favicon |
OLD | NEW |