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

Side by Side Diff: content/common/font_descriptor_mac.mm

Issue 6289009: [Mac] Implement the system dictionary popup by implementing NSTextInput methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Clang Created 9 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « content/common/font_descriptor_mac.h ('k') | content/common/font_descriptor_mac_unittest.mm » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/common/font_descriptor_mac.h" 5 #include "content/common/font_descriptor_mac.h"
6 6
7 #include <Cocoa/Cocoa.h> 7 #include <Cocoa/Cocoa.h>
8 8
9 #include "base/sys_string_conversions.h" 9 #include "base/sys_string_conversions.h"
10 10
11 FontDescriptor::FontDescriptor(NSFont* font) { 11 FontDescriptor::FontDescriptor(NSFont* font) {
12 font_name = base::SysNSStringToUTF16([font fontName]); 12 font_name = base::SysNSStringToUTF16([font fontName]);
13 font_point_size = [font pointSize]; 13 font_point_size = [font pointSize];
14 } 14 }
15 15
16 NSFont* FontDescriptor::nsFont() const { 16 FontDescriptor::FontDescriptor(string16 name, float size) {
17 font_name = name;
18 font_point_size = size;
19 }
20
21 NSFont* FontDescriptor::ToNSFont() const {
17 NSString* font_name_ns = base::SysUTF16ToNSString(font_name); 22 NSString* font_name_ns = base::SysUTF16ToNSString(font_name);
18 NSFont* font = [NSFont fontWithName:font_name_ns size:font_point_size]; 23 NSFont* font = [NSFont fontWithName:font_name_ns size:font_point_size];
19 return font; 24 return font;
20 } 25 }
OLDNEW
« no previous file with comments | « content/common/font_descriptor_mac.h ('k') | content/common/font_descriptor_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698