summaryrefslogtreecommitdiffstats
path: root/views/controls
diff options
context:
space:
mode:
Diffstat (limited to 'views/controls')
-rw-r--r--views/controls/button/text_button.cc3
-rw-r--r--views/controls/label.cc6
2 files changed, 6 insertions, 3 deletions
diff --git a/views/controls/button/text_button.cc b/views/controls/button/text_button.cc
index 578be80..1df698a 100644
--- a/views/controls/button/text_button.cc
+++ b/views/controls/button/text_button.cc
@@ -9,6 +9,7 @@
#include "app/throb_animation.h"
#include "app/resource_bundle.h"
#include "base/logging.h"
+#include "base/utf_string_conversions.h"
#include "gfx/canvas_skia.h"
#include "views/controls/button/button.h"
#include "views/event.h"
@@ -402,7 +403,7 @@ void TextButton::UpdateColor() {
void TextButton::UpdateTextSize() {
int width = 0, height = 0;
gfx::CanvasSkia::SizeStringInt(
- text_, font_, &width, &height,
+ WideToUTF16Hack(text_), font_, &width, &height,
gfx::Canvas::NO_ELLIPSIS | PrefixTypeToCanvasType(prefix_type_));
// Add 2 extra pixels to width and height when text halo is used.
diff --git a/views/controls/label.cc b/views/controls/label.cc
index 32df88a..b228c78b 100644
--- a/views/controls/label.cc
+++ b/views/controls/label.cc
@@ -68,7 +68,8 @@ int Label::GetHeightForWidth(int w) {
w = std::max(0, w - GetInsets().width());
int h = font_.GetHeight();
- gfx::CanvasSkia::SizeStringInt(text_, font_, &w, &h, ComputeMultiLineFlags());
+ gfx::CanvasSkia::SizeStringInt(WideToUTF16Hack(text_), font_, &w, &h,
+ ComputeMultiLineFlags());
return h + GetInsets().height();
}
@@ -294,7 +295,8 @@ gfx::Size Label::GetTextSize() const {
int flags = ComputeMultiLineFlags();
if (!is_multi_line_)
flags |= gfx::Canvas::NO_ELLIPSIS;
- gfx::CanvasSkia::SizeStringInt(text_, font_, &w, &h, flags);
+ gfx::CanvasSkia::SizeStringInt(WideToUTF16Hack(text_), font_, &w, &h,
+ flags);
text_size_.SetSize(w, h);
text_size_valid_ = true;
}