summaryrefslogtreecommitdiffstats
path: root/ui/gfx
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-07 16:55:42 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-07 16:55:42 +0000
commitcb1f4ac35e1e687925fdf62f7f62140dcd6d4a1d (patch)
tree953168adbbb3a7ff1c069911b764ffbed2369384 /ui/gfx
parentb7a95ad6f584b029954c3b398993f49f1d69265e (diff)
downloadchromium_src-cb1f4ac35e1e687925fdf62f7f62140dcd6d4a1d.zip
chromium_src-cb1f4ac35e1e687925fdf62f7f62140dcd6d4a1d.tar.gz
chromium_src-cb1f4ac35e1e687925fdf62f7f62140dcd6d4a1d.tar.bz2
Move StringToLowerASCII to base namespace
TBR=sky Review URL: https://codereview.chromium.org/448853002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288085 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx')
-rw-r--r--ui/gfx/font_fallback_win.cc4
-rw-r--r--ui/gfx/font_list_unittest.cc6
-rw-r--r--ui/gfx/font_unittest.cc15
-rw-r--r--ui/gfx/render_text_unittest.cc5
4 files changed, 19 insertions, 11 deletions
diff --git a/ui/gfx/font_fallback_win.cc b/ui/gfx/font_fallback_win.cc
index bfa6bc0..2e1959b 100644
--- a/ui/gfx/font_fallback_win.cc
+++ b/ui/gfx/font_fallback_win.cc
@@ -28,7 +28,7 @@ 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(base::WideToUTF8(it.Value()));
+ base::StringToLowerASCII(base::WideToUTF8(it.Value()));
(*map)[filename] = base::WideToUTF8(it.Name());
}
}
@@ -43,7 +43,7 @@ void GetFontNamesFromFilename(const std::string& filename,
QueryFontsFromRegistry(font_map);
std::map<std::string, std::string>::const_iterator it =
- font_map->find(StringToLowerASCII(filename));
+ font_map->find(base::StringToLowerASCII(filename));
if (it == font_map->end())
return;
diff --git a/ui/gfx/font_list_unittest.cc b/ui/gfx/font_list_unittest.cc
index b96de46..fc5f839 100644
--- a/ui/gfx/font_list_unittest.cc
+++ b/ui/gfx/font_list_unittest.cc
@@ -259,7 +259,8 @@ TEST(FontListTest, Fonts_DeriveWithSizeDelta) {
TEST(FontListTest, Fonts_GetHeight_GetBaseline) {
// If a font list has only one font, the height and baseline must be the same.
Font font1("Arial", 16);
- ASSERT_EQ("arial", StringToLowerASCII(font1.GetActualFontNameForTesting()));
+ ASSERT_EQ("arial",
+ base::StringToLowerASCII(font1.GetActualFontNameForTesting()));
FontList font_list1("Arial, 16px");
EXPECT_EQ(font1.GetHeight(), font_list1.GetHeight());
EXPECT_EQ(font1.GetBaseline(), font_list1.GetBaseline());
@@ -267,7 +268,8 @@ TEST(FontListTest, Fonts_GetHeight_GetBaseline) {
// If there are two different fonts, the font list returns the max value
// for ascent and descent.
Font font2("Symbol", 16);
- ASSERT_EQ("symbol", StringToLowerASCII(font2.GetActualFontNameForTesting()));
+ ASSERT_EQ("symbol",
+ base::StringToLowerASCII(font2.GetActualFontNameForTesting()));
EXPECT_NE(font1.GetBaseline(), font2.GetBaseline());
EXPECT_NE(font1.GetHeight() - font1.GetBaseline(),
font2.GetHeight() - font2.GetBaseline());
diff --git a/ui/gfx/font_unittest.cc b/ui/gfx/font_unittest.cc
index da4bdfc..3c043c0 100644
--- a/ui/gfx/font_unittest.cc
+++ b/ui/gfx/font_unittest.cc
@@ -64,7 +64,8 @@ TEST_F(FontTest, LoadArial) {
EXPECT_EQ(cf.GetStyle(), Font::NORMAL);
EXPECT_EQ(cf.GetFontSize(), 16);
EXPECT_EQ(cf.GetFontName(), "Arial");
- EXPECT_EQ("arial", StringToLowerASCII(cf.GetActualFontNameForTesting()));
+ EXPECT_EQ("arial",
+ base::StringToLowerASCII(cf.GetActualFontNameForTesting()));
FreeIfNecessary(native);
}
@@ -74,7 +75,8 @@ TEST_F(FontTest, LoadArialBold) {
NativeFont native = bold.GetNativeFont();
EXPECT_TRUE(native);
EXPECT_EQ(bold.GetStyle(), Font::BOLD);
- EXPECT_EQ("arial", StringToLowerASCII(cf.GetActualFontNameForTesting()));
+ EXPECT_EQ("arial",
+ base::StringToLowerASCII(cf.GetActualFontNameForTesting()));
FreeIfNecessary(native);
}
@@ -115,13 +117,15 @@ TEST_F(FontTest, AvgWidths) {
// http://crbug.com/347429
TEST_F(FontTest, GetActualFontNameForTesting) {
Font arial("Arial", 16);
- EXPECT_EQ("arial", StringToLowerASCII(arial.GetActualFontNameForTesting()))
+ EXPECT_EQ("arial",
+ base::StringToLowerASCII(arial.GetActualFontNameForTesting()))
<< "********\n"
<< "Your test environment seems to be missing Arial font, which is "
<< "needed for unittests. Check if Arial font is installed.\n"
<< "********";
Font symbol("Symbol", 16);
- EXPECT_EQ("symbol", StringToLowerASCII(symbol.GetActualFontNameForTesting()))
+ EXPECT_EQ("symbol",
+ base::StringToLowerASCII(symbol.GetActualFontNameForTesting()))
<< "********\n"
<< "Your test environment seems to be missing Symbol font, which is "
<< "needed for unittests. Check if Symbol font is installed.\n"
@@ -130,7 +134,8 @@ TEST_F(FontTest, GetActualFontNameForTesting) {
const char* const invalid_font_name = "no_such_font_name";
Font fallback_font(invalid_font_name, 16);
EXPECT_NE(invalid_font_name,
- StringToLowerASCII(fallback_font.GetActualFontNameForTesting()));
+ base::StringToLowerASCII(
+ fallback_font.GetActualFontNameForTesting()));
}
#endif
diff --git a/ui/gfx/render_text_unittest.cc b/ui/gfx/render_text_unittest.cc
index 751942e..108beb3 100644
--- a/ui/gfx/render_text_unittest.cc
+++ b/ui/gfx/render_text_unittest.cc
@@ -1345,10 +1345,11 @@ TEST_F(RenderTextTest, StringSizeRespectsFontListMetrics) {
// Check that Arial and Symbol have different font metrics.
Font arial_font("Arial", 16);
ASSERT_EQ("arial",
- StringToLowerASCII(arial_font.GetActualFontNameForTesting()));
+ base::StringToLowerASCII(arial_font.GetActualFontNameForTesting()));
Font symbol_font("Symbol", 16);
ASSERT_EQ("symbol",
- StringToLowerASCII(symbol_font.GetActualFontNameForTesting()));
+ base::StringToLowerASCII(
+ symbol_font.GetActualFontNameForTesting()));
EXPECT_NE(arial_font.GetHeight(), symbol_font.GetHeight());
EXPECT_NE(arial_font.GetBaseline(), symbol_font.GetBaseline());
// "a" should be rendered with Arial, not with Symbol.