Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(850)

Unified Diff: chrome/browser/chromeos/dom_ui/menu_ui.cc

Issue 6121004: Remove wstring from gfx. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,30 @@
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 @@
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));
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_popup_view_mac_unittest.mm ('k') | chrome/browser/chromeos/drop_shadow_label.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698