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

Side by Side Diff: ui/gfx/platform_font_ios.mm

Issue 16051006: ui/gfx: Use base::string16 now that string16 was moved into base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 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 unified diff | Download patch
« no previous file with comments | « ui/gfx/platform_font_ios.h ('k') | ui/gfx/platform_font_mac.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/platform_font_ios.h" 5 #include "ui/gfx/platform_font_ios.h"
6 6
7 #import <UIKit/UIKit.h> 7 #import <UIKit/UIKit.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 } 48 }
49 49
50 int PlatformFontIOS::GetBaseline() const { 50 int PlatformFontIOS::GetBaseline() const {
51 return ascent_; 51 return ascent_;
52 } 52 }
53 53
54 int PlatformFontIOS::GetAverageCharacterWidth() const { 54 int PlatformFontIOS::GetAverageCharacterWidth() const {
55 return average_width_; 55 return average_width_;
56 } 56 }
57 57
58 int PlatformFontIOS::GetStringWidth(const string16& text) const { 58 int PlatformFontIOS::GetStringWidth(const base::string16& text) const {
59 NSString* ns_text = base::SysUTF16ToNSString(text); 59 NSString* ns_text = base::SysUTF16ToNSString(text);
60 return [ns_text sizeWithFont:GetNativeFont()].width; 60 return [ns_text sizeWithFont:GetNativeFont()].width;
61 } 61 }
62 62
63 int PlatformFontIOS::GetExpectedTextWidth(int length) const { 63 int PlatformFontIOS::GetExpectedTextWidth(int length) const {
64 return length * average_width_; 64 return length * average_width_;
65 } 65 }
66 66
67 int PlatformFontIOS::GetStyle() const { 67 int PlatformFontIOS::GetStyle() const {
68 return style_; 68 return style_;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 return new PlatformFontIOS(native_font); 119 return new PlatformFontIOS(native_font);
120 } 120 }
121 121
122 // static 122 // static
123 PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name, 123 PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name,
124 int font_size) { 124 int font_size) {
125 return new PlatformFontIOS(font_name, font_size); 125 return new PlatformFontIOS(font_name, font_size);
126 } 126 }
127 127
128 } // namespace gfx 128 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/platform_font_ios.h ('k') | ui/gfx/platform_font_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698