diff options
Diffstat (limited to 'ui/gfx')
-rw-r--r-- | ui/gfx/canvas_unittest.cc | 4 | ||||
-rw-r--r-- | ui/gfx/font_fallback_win.cc | 10 | ||||
-rw-r--r-- | ui/gfx/font_unittest.cc | 2 | ||||
-rw-r--r-- | ui/gfx/pango_util.cc | 6 | ||||
-rw-r--r-- | ui/gfx/platform_font_pango.cc | 4 | ||||
-rw-r--r-- | ui/gfx/platform_font_win.cc | 4 | ||||
-rw-r--r-- | ui/gfx/render_text_unittest.cc | 3 | ||||
-rw-r--r-- | ui/gfx/render_text_win.cc | 3 | ||||
-rw-r--r-- | ui/gfx/screen_win.cc | 3 | ||||
-rw-r--r-- | ui/gfx/text_elider.cc | 4 | ||||
-rw-r--r-- | ui/gfx/text_elider_unittest.cc | 5 | ||||
-rw-r--r-- | ui/gfx/text_utils_unittest.cc | 11 |
12 files changed, 39 insertions, 20 deletions
diff --git a/ui/gfx/canvas_unittest.cc b/ui/gfx/canvas_unittest.cc index 21b9f51..baac0ab5 100644 --- a/ui/gfx/canvas_unittest.cc +++ b/ui/gfx/canvas_unittest.cc @@ -14,11 +14,11 @@ namespace gfx { class CanvasTest : public testing::Test { protected: int GetStringWidth(const char *text) { - return Canvas::GetStringWidth(UTF8ToUTF16(text), font_); + return Canvas::GetStringWidth(base::UTF8ToUTF16(text), font_); } gfx::Size SizeStringInt(const char *text, int width, int line_height) { - base::string16 text16 = UTF8ToUTF16(text); + base::string16 text16 = base::UTF8ToUTF16(text); int height = 0; int flags = (text16.find('\n') != base::string16::npos) ? Canvas::MULTI_LINE : 0; diff --git a/ui/gfx/font_fallback_win.cc b/ui/gfx/font_fallback_win.cc index 40666ee..ab363e4 100644 --- a/ui/gfx/font_fallback_win.cc +++ b/ui/gfx/font_fallback_win.cc @@ -24,8 +24,9 @@ void QueryFontsFromRegistry(std::map<std::string, std::string>* map) { base::win::RegistryValueIterator it(HKEY_LOCAL_MACHINE, kFonts); for (; it.Valid(); ++it) { - const std::string filename = StringToLowerASCII(WideToUTF8(it.Value())); - (*map)[filename] = WideToUTF8(it.Name()); + const std::string filename = + StringToLowerASCII(base::WideToUTF8(it.Value())); + (*map)[filename] = base::WideToUTF8(it.Name()); } } @@ -69,7 +70,7 @@ void QueryLinkedFontsFromRegistry(const Font& font, if (FAILED(key.Open(HKEY_LOCAL_MACHINE, kSystemLink, KEY_READ))) return; - const std::wstring original_font_name = UTF8ToWide(font.GetFontName()); + const std::wstring original_font_name = base::UTF8ToWide(font.GetFontName()); std::vector<std::wstring> values; if (FAILED(key.ReadValues(original_font_name.c_str(), &values))) { key.Close(); @@ -79,7 +80,8 @@ void QueryLinkedFontsFromRegistry(const Font& font, std::string filename; std::string font_name; for (size_t i = 0; i < values.size(); ++i) { - internal::ParseFontLinkEntry(WideToUTF8(values[i]), &filename, &font_name); + internal::ParseFontLinkEntry( + base::WideToUTF8(values[i]), &filename, &font_name); // If the font name is present, add that directly, otherwise add the // font names corresponding to the filename. if (!font_name.empty()) { diff --git a/ui/gfx/font_unittest.cc b/ui/gfx/font_unittest.cc index 720340b..32216d6 100644 --- a/ui/gfx/font_unittest.cc +++ b/ui/gfx/font_unittest.cc @@ -15,6 +15,8 @@ #include "ui/gfx/platform_font_win.h" #endif +using base::ASCIIToUTF16; + namespace gfx { namespace { diff --git a/ui/gfx/pango_util.cc b/ui/gfx/pango_util.cc index 1f8ac26..3716cf1 100644 --- a/ui/gfx/pango_util.cc +++ b/ui/gfx/pango_util.cc @@ -211,7 +211,7 @@ static void SetupPangoLayoutWithoutFont( // Set text and accelerator character if needed. if (flags & Canvas::SHOW_PREFIX) { // Escape the text string to be used as markup. - std::string utf8 = UTF16ToUTF8(text); + std::string utf8 = base::UTF16ToUTF8(text); gchar* escaped_text = g_markup_escape_text(utf8.c_str(), utf8.size()); pango_layout_set_markup_with_accel(layout, escaped_text, @@ -229,9 +229,9 @@ static void SetupPangoLayoutWithoutFont( RemoveAcceleratorChar(text, static_cast<base::char16>(kAcceleratorChar), NULL, NULL); - utf8 = UTF16ToUTF8(accelerator_removed); + utf8 = base::UTF16ToUTF8(accelerator_removed); } else { - utf8 = UTF16ToUTF8(text); + utf8 = base::UTF16ToUTF8(text); } pango_layout_set_text(layout, utf8.data(), utf8.size()); diff --git a/ui/gfx/platform_font_pango.cc b/ui/gfx/platform_font_pango.cc index bae1a4b..a4c6f89 100644 --- a/ui/gfx/platform_font_pango.cc +++ b/ui/gfx/platform_font_pango.cc @@ -392,8 +392,8 @@ void PlatformFontPango::InitPangoMetrics() { // Yes, this is how Microsoft recommends calculating the dialog unit // conversions. - const int text_width_pixels = GetStringWidth( - ASCIIToUTF16("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")); + const int text_width_pixels = GetStringWidth(base::ASCIIToUTF16( + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")); const double dialog_units_pixels = (text_width_pixels / 26 + 1) / 2; average_width_pixels_ = std::min(pango_width_pixels, dialog_units_pixels); } diff --git a/ui/gfx/platform_font_win.cc b/ui/gfx/platform_font_win.cc index 0209be6..5f9a137 100644 --- a/ui/gfx/platform_font_win.cc +++ b/ui/gfx/platform_font_win.cc @@ -211,7 +211,7 @@ void PlatformFontWin::InitWithCopyOfHFONT(HFONT hfont) { void PlatformFontWin::InitWithFontNameAndSize(const std::string& font_name, int font_size) { HFONT hf = ::CreateFont(-font_size, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - UTF8ToUTF16(font_name).c_str()); + base::UTF8ToUTF16(font_name).c_str()); font_ref_ = CreateHFontRef(hf); } @@ -289,7 +289,7 @@ PlatformFontWin::HFontRef::HFontRef(HFONT hfont, LOGFONT font_info; GetObject(hfont_, sizeof(LOGFONT), &font_info); - font_name_ = UTF16ToUTF8(base::string16(font_info.lfFaceName)); + font_name_ = base::UTF16ToUTF8(base::string16(font_info.lfFaceName)); if (font_info.lfHeight < 0) requested_font_size_ = -font_info.lfHeight; } diff --git a/ui/gfx/render_text_unittest.cc b/ui/gfx/render_text_unittest.cc index c8c50d4..cfa5fe6 100644 --- a/ui/gfx/render_text_unittest.cc +++ b/ui/gfx/render_text_unittest.cc @@ -28,6 +28,9 @@ #include <gtk/gtk.h> #endif +using base::ASCIIToUTF16; +using base::WideToUTF16; + namespace gfx { namespace { diff --git a/ui/gfx/render_text_win.cc b/ui/gfx/render_text_win.cc index 4afbc7f..881c8b6 100644 --- a/ui/gfx/render_text_win.cc +++ b/ui/gfx/render_text_win.cc @@ -86,7 +86,8 @@ bool ChooseFallbackFont(HDC hdc, log_font.lfFaceName[0] = 0; EnumEnhMetaFile(0, meta_file, MetaFileEnumProc, &log_font, NULL); if (log_font.lfFaceName[0]) { - *result = Font(UTF16ToUTF8(log_font.lfFaceName), font.GetFontSize()); + *result = Font(base::UTF16ToUTF8(log_font.lfFaceName), + font.GetFontSize()); found_fallback = true; } } diff --git a/ui/gfx/screen_win.cc b/ui/gfx/screen_win.cc index 5413c9f..2a03d65 100644 --- a/ui/gfx/screen_win.cc +++ b/ui/gfx/screen_win.cc @@ -25,7 +25,8 @@ MONITORINFOEX GetMonitorInfoForMonitor(HMONITOR monitor) { gfx::Display GetDisplay(MONITORINFOEX& monitor_info) { // TODO(oshima): Implement Observer. - int64 id = static_cast<int64>(base::Hash(WideToUTF8(monitor_info.szDevice))); + int64 id = static_cast<int64>( + base::Hash(base::WideToUTF8(monitor_info.szDevice))); gfx::Rect bounds = gfx::Rect(monitor_info.rcMonitor); gfx::Display display(id, bounds); display.set_work_area(gfx::Rect(monitor_info.rcWork)); diff --git a/ui/gfx/text_elider.cc b/ui/gfx/text_elider.cc index 0fa8388..74f6770 100644 --- a/ui/gfx/text_elider.cc +++ b/ui/gfx/text_elider.cc @@ -30,6 +30,10 @@ #include "ui/gfx/text_utils.h" #include "url/gurl.h" +using base::ASCIIToUTF16; +using base::UTF8ToUTF16; +using base::WideToUTF16; + namespace gfx { // U+2026 in utf8 diff --git a/ui/gfx/text_elider_unittest.cc b/ui/gfx/text_elider_unittest.cc index a97d764..e8a5aab 100644 --- a/ui/gfx/text_elider_unittest.cc +++ b/ui/gfx/text_elider_unittest.cc @@ -17,6 +17,11 @@ #include "ui/gfx/text_utils.h" #include "url/gurl.h" +using base::ASCIIToUTF16; +using base::UTF16ToUTF8; +using base::UTF8ToUTF16; +using base::WideToUTF16; + namespace gfx { namespace { diff --git a/ui/gfx/text_utils_unittest.cc b/ui/gfx/text_utils_unittest.cc index 1090b38..083f423 100644 --- a/ui/gfx/text_utils_unittest.cc +++ b/ui/gfx/text_utils_unittest.cc @@ -48,11 +48,12 @@ TEST(TextUtilsTest, RemoveAcceleratorChar) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) { int accelerated_char_pos; int accelerated_char_span; - base::string16 result = RemoveAcceleratorChar(UTF8ToUTF16(cases[i].input), - kAcceleratorChar, - &accelerated_char_pos, - &accelerated_char_span); - EXPECT_EQ(result, UTF8ToUTF16(cases[i].output)); + base::string16 result = RemoveAcceleratorChar( + base::UTF8ToUTF16(cases[i].input), + kAcceleratorChar, + &accelerated_char_pos, + &accelerated_char_span); + EXPECT_EQ(result, base::UTF8ToUTF16(cases[i].output)); EXPECT_EQ(accelerated_char_pos, cases[i].accelerated_char_pos); EXPECT_EQ(accelerated_char_span, cases[i].accelerated_char_span); } |