diff options
Diffstat (limited to 'chrome/browser/chromeos')
-rw-r--r-- | chrome/browser/chromeos/dom_ui/menu_ui.cc | 26 | ||||
-rw-r--r-- | chrome/browser/chromeos/drop_shadow_label.cc | 9 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/oobe_progress_bar.cc | 2 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/username_view.cc | 8 | ||||
-rw-r--r-- | chrome/browser/chromeos/panels/panel_scroller_header.cc | 8 |
5 files changed, 27 insertions, 26 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)); diff --git a/chrome/browser/chromeos/drop_shadow_label.cc b/chrome/browser/chromeos/drop_shadow_label.cc index 5c5fa30..4876643 100644 --- a/chrome/browser/chromeos/drop_shadow_label.cc +++ b/chrome/browser/chromeos/drop_shadow_label.cc @@ -4,6 +4,7 @@ #include "chrome/browser/chromeos/drop_shadow_label.h" +#include "base/utf_string_conversions.h" #include "gfx/canvas.h" #include "gfx/color_utils.h" @@ -44,19 +45,19 @@ void DropShadowLabel::PaintText(gfx::Canvas* canvas, SkColorGetG(kDefaultColor), SkColorGetB(kDefaultColor)); for (int i = 0; i < drop_shadow_size_; i++) { - canvas->DrawStringInt(text, font(), color, + canvas->DrawStringInt(WideToUTF16Hack(text), font(), color, text_bounds.x() + i, text_bounds.y(), text_bounds.width(), text_bounds.height(), flags); - canvas->DrawStringInt(text, font(), color, + canvas->DrawStringInt(WideToUTF16Hack(text), font(), color, text_bounds.x() + i, text_bounds.y() + i, text_bounds.width(), text_bounds.height(), flags); - canvas->DrawStringInt(text, font(), color, + canvas->DrawStringInt(WideToUTF16Hack(text), font(), color, text_bounds.x(), text_bounds.y() + i, text_bounds.width(), text_bounds.height(), flags); } } - canvas->DrawStringInt(text, font(), GetColor(), + canvas->DrawStringInt(WideToUTF16Hack(text), font(), GetColor(), text_bounds.x(), text_bounds.y(), text_bounds.width(), text_bounds.height(), flags); diff --git a/chrome/browser/chromeos/login/oobe_progress_bar.cc b/chrome/browser/chromeos/login/oobe_progress_bar.cc index 82b50de..5eafe52 100644 --- a/chrome/browser/chromeos/login/oobe_progress_bar.cc +++ b/chrome/browser/chromeos/login/oobe_progress_bar.cc @@ -111,7 +111,7 @@ void OobeProgressBar::Paint(gfx::Canvas* canvas) { next_x - ix, line_->height()); } - std::wstring str = UTF16ToWide(l10n_util::GetStringUTF16(steps_[i])); + string16 str = l10n_util::GetStringUTF16(steps_[i]); canvas->DrawStringInt(str, font_, color, x + kTextPadding, y + dot->height() + kTextPadding, (next_x - x - 2 * kTextPadding), diff --git a/chrome/browser/chromeos/login/username_view.cc b/chrome/browser/chromeos/login/username_view.cc index 5206901..b454b2f 100644 --- a/chrome/browser/chromeos/login/username_view.cc +++ b/chrome/browser/chromeos/login/username_view.cc @@ -155,10 +155,10 @@ void UsernameView::PaintUsername(const gfx::Rect& bounds) { // Note, direct call of the DrawStringInt method produces the green dots // along the text perimeter (when the label is place on the white background). SkColor kInvisibleHaloColor = 0x00000000; - canvas.DrawStringWithHalo(GetText(), font(), GetColor(), kInvisibleHaloColor, - bounds.x() + margin_width_, bounds.y(), - bounds.width() - 2 * margin_width_, bounds.height(), - flags); + canvas.DrawStringWithHalo(WideToUTF16Hack(GetText()), font(), GetColor(), + kInvisibleHaloColor, bounds.x() + margin_width_, + bounds.y(), bounds.width() - 2 * margin_width_, + bounds.height(), flags); text_image_.reset(new SkBitmap(canvas.ExtractBitmap())); diff --git a/chrome/browser/chromeos/panels/panel_scroller_header.cc b/chrome/browser/chromeos/panels/panel_scroller_header.cc index f6dceea..d4ef8fb 100644 --- a/chrome/browser/chromeos/panels/panel_scroller_header.cc +++ b/chrome/browser/chromeos/panels/panel_scroller_header.cc @@ -1,6 +1,6 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this -// source code is governed by a BSD-style license that can be found in the -// LICENSE file. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. #include "chrome/browser/chromeos/panels/panel_scroller_header.h" @@ -45,6 +45,6 @@ void PanelScrollerHeader::Paint(gfx::Canvas* canvas) { gfx::Font font = rb.GetFont(ResourceBundle::BaseFont).DeriveFont(0, gfx::Font::BOLD); int font_top = 1; - canvas->DrawStringInt(UTF16ToWideHack(title_), font, 0xFF000000, 3, font_top, + canvas->DrawStringInt(title_, font, 0xFF000000, 3, font_top, size().width(), size().height() - font_top); } |