Chromium Code Reviews| Index: chrome/browser/chromeos/dom_ui/menu_ui.cc |
| =================================================================== |
| --- chrome/browser/chromeos/dom_ui/menu_ui.cc (revision 71043) |
| +++ chrome/browser/chromeos/dom_ui/menu_ui.cc (working copy) |
| @@ -43,30 +43,29 @@ |
| const int kNoExtraResource = -1; |
| // A utility function that generates css font property from gfx::Font. |
|
evanm
2011/01/11 21:56:47
May wanna tag this as returning UTF-8, since we do
Avi (use Gerrit)
2011/01/11 22:15:28
Good point.
|
| -std::wstring GetFontShorthand(const gfx::Font* font) { |
| - std::wstring out; |
| +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 +618,7 @@ |
| 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)); |