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

Unified Diff: ui/gfx/platform_font_mac.mm

Issue 8392017: Change string16 to std::string in the gfx::Font() interface. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add 'UTF-8' everywhere in the comments Created 9 years, 2 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
« no previous file with comments | « ui/gfx/platform_font_mac.h ('k') | ui/gfx/platform_font_pango.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/platform_font_mac.mm
diff --git a/ui/gfx/platform_font_mac.mm b/ui/gfx/platform_font_mac.mm
index 48bb4c8ebb9a25da4a0186de2ec47f309f7a96db..ee12a330fccc74382096361626bd12bb2392b442 100644
--- a/ui/gfx/platform_font_mac.mm
+++ b/ui/gfx/platform_font_mac.mm
@@ -22,7 +22,7 @@ PlatformFontMac::PlatformFontMac() {
font_size_ = [NSFont systemFontSize];
style_ = gfx::Font::NORMAL;
NSFont* system_font = [NSFont systemFontOfSize:font_size_];
- font_name_ = base::SysNSStringToUTF16([system_font fontName]);
+ font_name_ = base::SysNSStringToUTF8([system_font fontName]);
CalculateMetrics();
}
@@ -32,7 +32,7 @@ PlatformFontMac::PlatformFontMac(const Font& other) {
PlatformFontMac::PlatformFontMac(NativeFont native_font) {
}
-PlatformFontMac::PlatformFontMac(const string16& font_name,
+PlatformFontMac::PlatformFontMac(const std::string& font_name,
int font_size) {
InitWithNameSizeAndStyle(font_name, font_size, gfx::Font::NORMAL);
}
@@ -71,7 +71,7 @@ int PlatformFontMac::GetStyle() const {
return style_;
}
-string16 PlatformFontMac::GetFontName() const {
+std::string PlatformFontMac::GetFontName() const {
return font_name_;
}
@@ -83,20 +83,20 @@ NativeFont PlatformFontMac::GetNativeFont() const {
// TODO(pinkerton): apply |style_| to font. http://crbug.com/34667
// We could cache this, but then we'd have to conditionally change the
// dtor just for MacOS. Not sure if we want to/need to do that.
- return [NSFont fontWithName:base::SysUTF16ToNSString(font_name_)
+ return [NSFont fontWithName:base::SysUTF8ToNSString(font_name_)
size:font_size_];
}
////////////////////////////////////////////////////////////////////////////////
// PlatformFontMac, private:
-PlatformFontMac::PlatformFontMac(const string16& font_name,
+PlatformFontMac::PlatformFontMac(const std::string& font_name,
int font_size,
int style) {
InitWithNameSizeAndStyle(font_name, font_size, style);
}
-void PlatformFontMac::InitWithNameSizeAndStyle(const string16& font_name,
+void PlatformFontMac::InitWithNameSizeAndStyle(const std::string& font_name,
int font_size,
int style) {
font_name_ = font_name;
@@ -134,7 +134,7 @@ PlatformFont* PlatformFont::CreateFromNativeFont(NativeFont native_font) {
}
// static
-PlatformFont* PlatformFont::CreateFromNameAndSize(const string16& font_name,
+PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name,
int font_size) {
return new PlatformFontMac(font_name, font_size);
}
« no previous file with comments | « ui/gfx/platform_font_mac.h ('k') | ui/gfx/platform_font_pango.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698