summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/dom_ui
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-12 14:37:16 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-12 14:37:16 +0000
commit3f891cf79f72f4768a15bfae051e08b9211ed8c3 (patch)
tree3cf8d59e7186889184f575fcbe3284e6400fb505 /chrome/browser/chromeos/dom_ui
parente0c7405b8f24e6c0096285446f94f729e63107df (diff)
downloadchromium_src-3f891cf79f72f4768a15bfae051e08b9211ed8c3.zip
chromium_src-3f891cf79f72f4768a15bfae051e08b9211ed8c3.tar.gz
chromium_src-3f891cf79f72f4768a15bfae051e08b9211ed8c3.tar.bz2
Remove wstring from gfx.
BUG=68882 TEST=no visible changes; all tests pass Review URL: http://codereview.chromium.org/6121004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71167 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/dom_ui')
-rw-r--r--chrome/browser/chromeos/dom_ui/menu_ui.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/chrome/browser/chromeos/dom_ui/menu_ui.cc b/chrome/browser/chromeos/dom_ui/menu_ui.cc
index 65536d9..70f49b9 100644
--- a/chrome/browser/chromeos/dom_ui/menu_ui.cc
+++ b/chrome/browser/chromeos/dom_ui/menu_ui.cc
@@ -43,30 +43,30 @@ namespace {
const int kNoExtraResource = -1;
// A utility function that generates css font property from gfx::Font.
-std::wstring GetFontShorthand(const gfx::Font* font) {
- std::wstring out;
+// NOTE: Returns UTF-8.
+std::string GetFontShorthand(const gfx::Font* font) {
+ std::string out;
if (font == NULL) {
font = &(views::MenuConfig::instance().font);
}
if (font->GetStyle() & gfx::Font::BOLD) {
- out.append(L"bold ");
+ out.append("bold ");
}
if (font->GetStyle() & gfx::Font::ITALIC) {
- out.append(L"italic ");
+ out.append("italic ");
}
if (font->GetStyle() & gfx::Font::UNDERLINED) {
- out.append(L"underline ");
+ out.append("underline ");
}
// TODO(oshima): The font size from gfx::Font is too small when
// used in webkit. Figure out the reason.
- out.append(ASCIIToWide(base::IntToString(font->GetFontSize() + 4)));
- out.append(L"px/");
- out.append(ASCIIToWide(base::IntToString(
- std::max(kFavIconSize, font->GetHeight()))));
- out.append(L"px \"");
- out.append(font->GetFontName());
- out.append(L"\",sans-serif");
+ out.append(base::IntToString(font->GetFontSize() + 4));
+ out.append("px/");
+ out.append(base::IntToString(std::max(kFavIconSize, font->GetHeight())));
+ out.append("px \"");
+ out.append(UTF16ToUTF8(font->GetFontName()));
+ out.append("\",sans-serif");
return out;
}
@@ -619,7 +619,7 @@ DictionaryValue* MenuUI::CreateMenuItem(const menus::MenuModel* model,
item->SetBoolean("checked", model->IsItemCheckedAt(index));
item->SetInteger("command_id", model->GetCommandIdAt(index));
item->SetString(
- "font", WideToUTF16(GetFontShorthand(model->GetLabelFontAt(index))));
+ "font", GetFontShorthand(model->GetLabelFontAt(index)));
SkBitmap icon;
if (model->GetIconAt(index, &icon) && !icon.isNull() && !icon.empty()) {
item->SetString("icon", dom_ui_util::GetImageDataUrl(icon));